Allow negation operator in ignore_groups option

e.g. ig['!String']
This commit is contained in:
Junegunn Choi
2014-06-24 00:07:48 +09:00
parent a98c1ccc99
commit fc9555cd65
3 changed files with 13 additions and 8 deletions

View File

@@ -37,8 +37,7 @@ let s:easy_align_delimiters_default = {
\ ',': { 'pattern': ',', 'left_margin': 0, 'right_margin': 1, 'stick_to_left': 1 },
\ '|': { 'pattern': '|', 'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0 },
\ '.': { 'pattern': '\.', 'left_margin': 0, 'right_margin': 0, 'stick_to_left': 0 },
\ '#': { 'pattern': '#\+',
\ 'delimiter_align': 'l', 'ignore_groups': ['^\(.\(Comment\)\@!\)*$'] },
\ '#': { 'pattern': '#\+', 'delimiter_align': 'l', 'ignore_groups': ['!Comment'] },
\ '&': { 'pattern': '\\\@<!&\|\\\\',
\ 'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0 },
\ '{': { 'pattern': '(\@<!{',
@@ -91,7 +90,11 @@ function! s:highlighted_as(line, col, groups)
if empty(a:groups) | return 0 | endif
let hl = synIDattr(synID(a:line, a:col, 0), 'name')
for grp in a:groups
if hl =~# grp
if grp[0] == '!'
if hl !~# grp[1:-1]
return 1
endif
elseif hl =~# grp
return 1
endif
endfor