won't break repeat if jump by the closed pair in the same line

This commit is contained in:
Miao Jiang 2016-03-28 13:12:41 +08:00
parent 15256d0e94
commit 5979999a17

View File

@ -148,8 +148,13 @@ function! AutoPairsInsert(key)
" Fly Mode, and the key is closed-pairs, search closed-pair and jump
if g:AutoPairsFlyMode && has_key(b:AutoPairsClosedPairs, a:key)
let n = stridx(after, a:key)
if n != -1
return repeat(s:Right, n+1)
end
if search(a:key, 'W')
return s:Right
" force break the '.' when jump to different line
return "\<Right>"
endif
endif