mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-15 21:33:47 -05:00
Added table highlight to autoformat blacklist
mattly/vim-markdown-enhancements defines a highlight for tables in markdown. We can use that to avoid inadvertent reformat of those tables by not enabling autoformat in those tables.
This commit is contained in:
@@ -54,7 +54,7 @@ fun! s:imap(preserve_completion, key, icmd)
|
|||||||
endf
|
endf
|
||||||
|
|
||||||
fun! s:enable_autoformat()
|
fun! s:enable_autoformat()
|
||||||
" don't enable autoformat if in a code block (TODO or table)
|
" don't enable autoformat if in a code block or table
|
||||||
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'),
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ if !exists('g:pencil#autoformat_blacklist')
|
|||||||
"'markdownCode', 'markdownHighlight[A-Za-z0-9]+' (tpope/vim-markdown)
|
"'markdownCode', 'markdownHighlight[A-Za-z0-9]+' (tpope/vim-markdown)
|
||||||
"'mkdCode', 'mkdIndentCode' (plasticboy/vim-markdown)
|
"'mkdCode', 'mkdIndentCode' (plasticboy/vim-markdown)
|
||||||
"'markdownFencedCodeBlock', 'markdownInlineCode' (gabrielelana/vim-markdown)
|
"'markdownFencedCodeBlock', 'markdownInlineCode' (gabrielelana/vim-markdown)
|
||||||
|
"'mmdTable[A-Za-z0-9]*' (mattly/vim-markdown-enhancements)
|
||||||
"'txtCode' (timcharper/textile.vim)
|
"'txtCode' (timcharper/textile.vim)
|
||||||
let g:pencil#autoformat_blacklist = [
|
let g:pencil#autoformat_blacklist = [
|
||||||
\ 'markdownCode',
|
\ 'markdownCode',
|
||||||
@@ -45,6 +46,7 @@ if !exists('g:pencil#autoformat_blacklist')
|
|||||||
\ 'mkdIndentCode',
|
\ 'mkdIndentCode',
|
||||||
\ 'markdownFencedCodeBlock',
|
\ 'markdownFencedCodeBlock',
|
||||||
\ 'markdownInlineCode',
|
\ 'markdownInlineCode',
|
||||||
|
\ 'mmdTable[A-Za-z0-9]*',
|
||||||
\ 'txtCode',
|
\ 'txtCode',
|
||||||
\ ]
|
\ ]
|
||||||
en
|
en
|
||||||
|
|||||||
Reference in New Issue
Block a user