mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Normalize generic syn method
This commit is contained in:
@@ -40,9 +40,13 @@ function! matchup#util#in_syntax(name, ...) " {{{1
|
||||
let l:pos = a:0 > 0 ? [a:1, a:2] : [line('.'), col('.')]
|
||||
|
||||
" check syntax at position
|
||||
let l:syn = map(synstack(l:pos[0], l:pos[1]),
|
||||
\ "synIDattr(synIDtrans(v:val), 'name')")
|
||||
return match(l:syn, a:name) >= 0
|
||||
" this is closer to the method used by most ftplugins
|
||||
let l:syn = synIDattr(synID(l:pos[0], l:pos[1], 1), 'name')
|
||||
return l:syn =~? a:name
|
||||
|
||||
" let l:syn = map(synstack(l:pos[0], l:pos[1]),
|
||||
" \ "synIDattr(synIDtrans(v:val), 'name')")
|
||||
" return match(l:syn, a:name) >= 0
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
Reference in New Issue
Block a user