diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2021-07-08 11:54:15 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2021-07-08 11:54:15 +0200 |
commit | c794f186c0a618d2d4cdd5445d9ff20e6f640762 (patch) | |
tree | 11e6b01bac01b0ec694c8fa5c574870f5e268182 /syntax/csv.vim | |
parent | 4f5388350be1052f610b830c8fce8fbc17370ec6 (diff) | |
download | vim-polyglot-c794f186c0a618d2d4cdd5445d9ff20e6f640762.tar.gz vim-polyglot-c794f186c0a618d2d4cdd5445d9ff20e6f640762.zip |
Update
Diffstat (limited to 'syntax/csv.vim')
-rw-r--r-- | syntax/csv.vim | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/syntax/csv.vim b/syntax/csv.vim index ed045c7f..0e1d3a02 100644 --- a/syntax/csv.vim +++ b/syntax/csv.vim @@ -55,6 +55,12 @@ fu! <sid>CheckSaneSearchPattern() "{{{3 let b:csv_cmt = [g:csv_comment] endif + " Make sure, b:csv_cmt always has 2 items + " can happen with e.g. :set cms="#%s + if b:csv_cmt == [] + let b:csv_cmt = ['', ''] + endif + " Second: Check for sane defaults for the column pattern " Not necessary to check for fixed width columns @@ -131,9 +137,11 @@ fu! <sid>DoHighlight() "{{{3 endfor endif " Comment regions - exe 'syn match CSVComment /'. s:cmts. '.*'. - \ (!empty(s:cmte) ? '\%('. s:cmte. '\)\?' - \: ''). '/' + if !empty(s:cmts) + exe 'syn match CSVComment /'. s:cmts. '.*'. + \ (!empty(s:cmte) ? '\%('. s:cmte. '\)\?' + \: ''). '/' + endif hi def link CSVComment Comment endfun |