mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Fix d]% when close is at column 1, fix #203
This commit is contained in:
@@ -196,7 +196,7 @@ function! matchup#motion#find_unmatched(visual, down, ...) " {{{1
|
||||
" this is an exclusive motion, ]%
|
||||
if l:delim.side ==# 'close'
|
||||
if l:exclusive
|
||||
let l:new_pos[1] -= 1
|
||||
let l:new_pos = matchup#pos#prev_eol(l:new_pos)[1:2]
|
||||
else
|
||||
let l:new_pos[1] += matchup#delim#end_offset(l:delim)
|
||||
endif
|
||||
|
||||
@@ -73,6 +73,17 @@ function! matchup#pos#next(...) " {{{1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
function! matchup#pos#prev_eol(...) " {{{1
|
||||
let [l:lnum, l:cnum; l:rest] = s:parse_args(a:000)
|
||||
|
||||
if l:cnum >= 1 && l:lnum > 1
|
||||
return [0, l:lnum - 1, strlen(getline(l:lnum - 1)) + 1, 0]
|
||||
else
|
||||
return matchup#pos#prev(l:lnum, l:cnum)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
function! matchup#pos#prev(...) " {{{1
|
||||
let [l:lnum, l:cnum; l:rest] = s:parse_args(a:000)
|
||||
@@ -86,6 +97,7 @@ function! matchup#pos#prev(...) " {{{1
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
function! matchup#pos#larger(pos1, pos2) " {{{1
|
||||
return matchup#pos#val(a:pos1) > matchup#pos#val(a:pos2)
|
||||
endfunction
|
||||
@@ -140,4 +152,3 @@ endfunction
|
||||
let &cpo = s:save_cpo
|
||||
|
||||
" vim: fdm=marker sw=2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user