From 19c1dba18f97281f93cf682d2f76f8c13cfce57f Mon Sep 17 00:00:00 2001 From: Reed Esau Date: Mon, 25 Aug 2014 02:11:37 -0600 Subject: [PATCH] #7 fix - avoid enabling autoformat for code blocks Found a bug with new feature and fixed. --- autoload/pencil.vim | 2 +- plugin/pencil.vim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/pencil.vim b/autoload/pencil.vim index a140982..431ecad 100644 --- a/autoload/pencil.vim +++ b/autoload/pencil.vim @@ -61,7 +61,7 @@ fun! s:enable_autoformat(mode) let l:okay_to_enable = 1 for l:sid in synstack(line('.'), col('.')) if match(synIDattr(l:sid, 'name'), - \ g:pencil#autoformat_exclude_re) == -1 + \ g:pencil#autoformat_exclude_re) >= 0 let l:okay_to_enable = 0 break en diff --git a/plugin/pencil.vim b/plugin/pencil.vim index 0826374..bee866b 100644 --- a/plugin/pencil.vim +++ b/plugin/pencil.vim @@ -42,7 +42,7 @@ if !exists('g:pencil#autoformat_exclude') \ ] en let g:pencil#autoformat_exclude_re = - \ '(' . join(g:pencil#autoformat_exclude, '|') . ')' + \ '\v(' . join(g:pencil#autoformat_exclude, '|') . ')' if !exists('g:pencil#joinspaces') " by default, only one space after full stop (.)