Fix crash in %

This commit is contained in:
Andy K. Massimino
2017-11-06 23:56:55 -05:00
parent 09cb6d0889
commit 8caa1af052
2 changed files with 3 additions and 1 deletions

View File

@@ -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

View File

@@ -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