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
|
let l:okay_to_enable = 1
|
||||||
for l:sid in synstack(line('.'), col('.'))
|
for l:sid in synstack(line('.'), col('.'))
|
||||||
if match(synIDattr(l:sid, 'name'),
|
if match(synIDattr(l:sid, 'name'),
|
||||||
\ g:pencil#autoformat_exclude_re) == -1
|
\ g:pencil#autoformat_exclude_re) >= 0
|
||||||
let l:okay_to_enable = 0
|
let l:okay_to_enable = 0
|
||||||
break
|
break
|
||||||
en
|
en
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if !exists('g:pencil#autoformat_exclude')
|
|||||||
\ ]
|
\ ]
|
||||||
en
|
en
|
||||||
let g:pencil#autoformat_exclude_re =
|
let g:pencil#autoformat_exclude_re =
|
||||||
\ '(' . join(g:pencil#autoformat_exclude, '|') . ')'
|
\ '\v(' . join(g:pencil#autoformat_exclude, '|') . ')'
|
||||||
|
|
||||||
if !exists('g:pencil#joinspaces')
|
if !exists('g:pencil#joinspaces')
|
||||||
" by default, only one space after full stop (.)
|
" by default, only one space after full stop (.)
|
||||||
|
|||||||
Reference in New Issue
Block a user