From 6b2ac2a3665b8a2517cfc727aa9dbef73a8cbe84 Mon Sep 17 00:00:00 2001 From: Jacob Zimmerman Date: Sun, 12 Feb 2017 22:39:30 -0500 Subject: [PATCH 1/2] Optionally disable definition lists In documents which make heavy use of definition lists, vim-pandoc causes Vim to re-render really slowly. Rather than attempt to figure out the cause of the slowness, I've chosen to optionally disable syntax highlighting of definition lists. --- doc/pandoc-syntax.txt | 4 ++++ syntax/pandoc.vim | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/pandoc-syntax.txt b/doc/pandoc-syntax.txt index dfb8fa4..ea29c69 100644 --- a/doc/pandoc-syntax.txt +++ b/doc/pandoc-syntax.txt @@ -77,6 +77,10 @@ CONFIGURATION *vim-pandoc-syntax-configuration* + *g:pandoc#syntax#style#underline_special* Undeline subscript, superscript and strikeout text styles. Default = 1 ++ *g:pandoc#syntax#style#use_definition_lists* + Detect and highlight definition lists. Looks really nice, but can result in + slower performance. Default = 1 (i.e., on by default) + COMMANDS *pandoc-syntax-commands* + *:PandocHighlight* LANG diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim index 2984704..24e3488 100644 --- a/syntax/pandoc.vim +++ b/syntax/pandoc.vim @@ -132,6 +132,11 @@ if !exists('g:pandoc#syntax#roman_lists') let g:pandoc#syntax#roman_lists = 0 endif " }}} +" disable syntax highlighting for definition lists? (better performances) {{{2 +if !exists('g:pandoc#syntax#use_definition_lists') + let g:pandoc#syntax#use_definition_lists = 1 +endif +" }}} "}}}1 " Functions: {{{1 @@ -435,9 +440,11 @@ syn match pandocListItemContinuation /^\s\+\([-+*]\s\+\|(\?.\+[).]\)\@ Date: Sun, 12 Feb 2017 23:18:06 -0500 Subject: [PATCH 2/2] Reword docs --- doc/pandoc-syntax.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/pandoc-syntax.txt b/doc/pandoc-syntax.txt index ea29c69..325b483 100644 --- a/doc/pandoc-syntax.txt +++ b/doc/pandoc-syntax.txt @@ -78,8 +78,8 @@ CONFIGURATION *vim-pandoc-syntax-configuration* Undeline subscript, superscript and strikeout text styles. Default = 1 + *g:pandoc#syntax#style#use_definition_lists* - Detect and highlight definition lists. Looks really nice, but can result in - slower performance. Default = 1 (i.e., on by default) + Detect and highlight definition lists. Disabling this can improve + performance. Default = 1 (i.e., enabled by default) COMMANDS *pandoc-syntax-commands*