mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Minor refactor for table syntax
This commit is contained in:
@@ -65,7 +65,10 @@ function! s:ToggleMapping() "{{{2
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! tablemode#SyntaxEnable() "{{{2
|
||||
function! s:ToggleSyntax() "{{{2
|
||||
if !g:table_mode_syntax | return | endif
|
||||
|
||||
if tablemode#IsActive()
|
||||
exec 'syntax match Table'
|
||||
\ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/'
|
||||
\ 'contains=TableBorder,TableSeparator,TableColumnAlign containedin=ALL'
|
||||
@@ -76,13 +79,6 @@ function! tablemode#SyntaxEnable() "{{{2
|
||||
hi! link TableBorder Delimiter
|
||||
hi! link TableSeparator Delimiter
|
||||
hi! link TableColumnAlign Type
|
||||
endfunction
|
||||
|
||||
function! s:ToggleSyntax()
|
||||
if !g:table_mode_syntax | return | endif
|
||||
|
||||
if tablemode#IsActive()
|
||||
call tablemode#SyntaxEnable()
|
||||
else
|
||||
syntax clear Table
|
||||
syntax clear TableBorder
|
||||
|
||||
Reference in New Issue
Block a user