diff --git a/autoload/matchup/delim.vim b/autoload/matchup/delim.vim index 70f72f5..659e83d 100644 --- a/autoload/matchup/delim.vim +++ b/autoload/matchup/delim.vim @@ -596,7 +596,7 @@ function! s:get_matching_delims(down) dict " {{{1 let l:open = matchup#delim#fill_backrefs(l:open, self.groups, 0) let l:close = matchup#delim#fill_backrefs(l:close, self.groups, 0) - let l:skip = 'matchup#delim#skip()' + let l:skip = 'matchup#delim#skip0()' if matchup#perf#timeout_check() | return [['', 0, 0]] | endif @@ -1161,6 +1161,15 @@ function! matchup#delim#skip(...) " {{{1 execute 'return (' b:matchup_delim_skip ')' endfunction +function! matchup#delim#skip0() + if empty(b:matchup_delim_skip) + return matchup#util#in_comment_or_string(line('.'), col('.')) + endif + + let s:eff_curpos = [line('.'), col('.')] + execute 'return (' b:matchup_delim_skip ')' +endfunction + let s:eff_curpos = [1, 1] " effective column/line diff --git a/autoload/matchup/pos.vim b/autoload/matchup/pos.vim index 9d0763e..c095973 100644 --- a/autoload/matchup/pos.vim +++ b/autoload/matchup/pos.vim @@ -12,9 +12,18 @@ function! matchup#pos#set_cursor(...) " {{{1 endfunction " }}}1 -function! matchup#pos#get_cursor() " {{{1 - return exists('*getcurpos') ? getcurpos() : getpos('.') -endfunction +" function! matchup#pos#get_cursor() {{{1 +if exists('*getcurpos') + function! matchup#pos#get_cursor() + return getcurpos() + endfunction +else + function! matchup#pos#get_cursor() + return getpos('.') + endfunction +endif + +" }}}1 " }}}1 function! matchup#pos#get_cursor_line() " {{{1