mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-08 09:53:49 -05:00
#7 fix - avoid enabling autoformat for code blocks
Found a bug with new feature and fixed.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 (.)
|
||||
|
||||
Reference in New Issue
Block a user