Add config to disable table mode syntax

Since table mode syntax can hamper performance, it is now possible to
disable it with a global config
This commit is contained in:
Dhruva Sagar
2017-01-04 15:45:48 +05:30
parent 441c30c35a
commit 9edd6d7d20
5 changed files with 15 additions and 9 deletions

View File

@@ -65,7 +65,7 @@ function! s:ToggleMapping() "{{{2
endif
endfunction
function! tablemode#SyntaxEnable()
function! tablemode#SyntaxEnable() "{{{2
exec 'syntax match Table'
\ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/'
\ 'contains=TableBorder,TableSeparator,TableColumnAlign containedin=ALL'
@@ -79,6 +79,8 @@ function! tablemode#SyntaxEnable()
endfunction
function! s:ToggleSyntax()
if !g:table_mode_syntax | return | endif
if tablemode#IsActive()
call tablemode#SyntaxEnable()
else