mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Fix crash in %
This commit is contained in:
@@ -174,6 +174,7 @@ function! matchup#delim#get_matching(delim, ...) " {{{1
|
||||
return l:matching_list
|
||||
else
|
||||
" old syntax: open->close, close->open
|
||||
if !len(l:matching_list) | return {} | endif
|
||||
return a:delim.side ==# 'open' ? l:matching_list[-1]
|
||||
\ : l:matching_list[0]
|
||||
endif
|
||||
|
||||
@@ -125,7 +125,8 @@ function! matchup#motion#find_matching_pair(visual, down) " {{{1
|
||||
" loop count number of times
|
||||
for l:dummy in range(v:count1)
|
||||
let l:matches = matchup#delim#get_matching(l:delim)
|
||||
let l:delim = l:delim.links[a:down ? 'next' : 'prev']
|
||||
if !len(l:matches) | return | endif
|
||||
let l:delim = get(l:delim.links, a:down ? 'next' : 'prev', {})
|
||||
if empty(l:delim) | return | endif
|
||||
endfor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user