From ad8c4b45040798b80e36233616b463d5ae670490 Mon Sep 17 00:00:00 2001 From: Reed Esau Date: Wed, 27 Aug 2014 05:17:38 -0600 Subject: [PATCH] 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. --- autoload/pencil.vim | 2 +- plugin/pencil.vim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/pencil.vim b/autoload/pencil.vim index 88f2ecf..42e982e 100644 --- a/autoload/pencil.vim +++ b/autoload/pencil.vim @@ -54,7 +54,7 @@ fun! s:imap(preserve_completion, key, icmd) endf 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 for l:sid in synstack(line('.'), col('.')) if match(synIDattr(l:sid, 'name'), diff --git a/plugin/pencil.vim b/plugin/pencil.vim index 272e1d9..ccfdeaa 100644 --- a/plugin/pencil.vim +++ b/plugin/pencil.vim @@ -37,6 +37,7 @@ if !exists('g:pencil#autoformat_blacklist') "'markdownCode', 'markdownHighlight[A-Za-z0-9]+' (tpope/vim-markdown) "'mkdCode', 'mkdIndentCode' (plasticboy/vim-markdown) "'markdownFencedCodeBlock', 'markdownInlineCode' (gabrielelana/vim-markdown) + "'mmdTable[A-Za-z0-9]*' (mattly/vim-markdown-enhancements) "'txtCode' (timcharper/textile.vim) let g:pencil#autoformat_blacklist = [ \ 'markdownCode', @@ -45,6 +46,7 @@ if !exists('g:pencil#autoformat_blacklist') \ 'mkdIndentCode', \ 'markdownFencedCodeBlock', \ 'markdownInlineCode', + \ 'mmdTable[A-Za-z0-9]*', \ 'txtCode', \ ] en