Fix jump incorrect
This commit is contained in:
parent
2de4b15cc5
commit
8d2f838205
@ -198,10 +198,10 @@ func! AutoPairsInsert(key)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if open != close
|
if open != close
|
||||||
let m = s:matchend(after, '^\v\s*\zs\V'.close)
|
let m = matchstr(after, '^\v\s*\zs\V'.close)
|
||||||
if len(m) > 0
|
if m != ''
|
||||||
" skip close pair greedy
|
" skip close pair greedy
|
||||||
call search(m[1], 'We')
|
call search(m, 'We')
|
||||||
return "\<Right>"
|
return "\<Right>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -285,6 +285,15 @@ func! AutoPairsDelete()
|
|||||||
return repeat("\<BS>", s:ulen(b)).repeat("\<DELETE>", s:ulen(a))
|
return repeat("\<BS>", s:ulen(b)).repeat("\<DELETE>", s:ulen(a))
|
||||||
end
|
end
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
return "\<BS>"
|
||||||
|
" delete the pair foo[]| <BS> to foo
|
||||||
|
for [open, close] in b:AutoPairsList
|
||||||
|
let m = s:matchend(before, '\V'.open.'\v\s*'.'\V'.close.'\v$')
|
||||||
|
if len(m) > 0
|
||||||
|
return s:backspace(m[2])
|
||||||
|
end
|
||||||
|
endfor
|
||||||
return "\<BS>"
|
return "\<BS>"
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user