mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-15 05:13:48 -05:00
Allow negation operator in ignore_groups option
e.g. ig['!String']
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user