mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-17 17:38:01 +00:00
Change default syntax skip method (fixes #82)
This commit is contained in:
@@ -40,14 +40,9 @@ function! matchup#util#in_syntax(name, ...) " {{{1
|
||||
" usage: matchup#util#in_syntax(name, [line, col])
|
||||
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, '\c'.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
|
||||
" check syntax at position (same as matchit's s: method)
|
||||
let l:syn = synIDattr(synID(l:pos[0], l:pos[1], 1), 'name')
|
||||
return l:syn =~? a:name
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
17
test/vader/syn.vader
Normal file
17
test/vader/syn.vader
Normal file
@@ -0,0 +1,17 @@
|
||||
Execute (opts):
|
||||
let matchup_matchparen_offscreen = {}
|
||||
let matchup_delim_noskips = 2
|
||||
|
||||
Given scheme (Syntax):
|
||||
(define procname ; ) in comment isn't matched as expected
|
||||
") in string is however matched"
|
||||
body)
|
||||
|
||||
Before ():
|
||||
2normal! f)
|
||||
|
||||
Do (%):
|
||||
%
|
||||
Then (Verify line):
|
||||
Assert line('.') == 2
|
||||
|
||||
Reference in New Issue
Block a user