Keep clipboard when fastwrap
This commit is contained in:
parent
738d1f18a8
commit
680f4fefcd
@ -185,7 +185,7 @@ func! AutoPairsInsert(key)
|
|||||||
" process the open pair
|
" process the open pair
|
||||||
|
|
||||||
" remove inserted pair
|
" remove inserted pair
|
||||||
" if the pairs include < > and <!-- -->
|
" eg: if the pairs include < > and <!-- -->
|
||||||
" when <!-- is detected the inserted pair < > should be clean up
|
" when <!-- is detected the inserted pair < > should be clean up
|
||||||
let bs = repeat("\<BS>", s:ulen(m)-1)
|
let bs = repeat("\<BS>", s:ulen(m)-1)
|
||||||
if bs != ''
|
if bs != ''
|
||||||
@ -199,10 +199,6 @@ func! AutoPairsInsert(key)
|
|||||||
|
|
||||||
" Fly Mode, and the key is closed-pairs, search closed-pair and jump
|
" Fly Mode, and the key is closed-pairs, search closed-pair and jump
|
||||||
if g:AutoPairsFlyMode && a:key =~ '\v[\}\]\)]'
|
if g:AutoPairsFlyMode && a:key =~ '\v[\}\]\)]'
|
||||||
let n = stridx(after, a:key)
|
|
||||||
if n != -1
|
|
||||||
return repeat(s:Right, n+1)
|
|
||||||
end
|
|
||||||
if search(a:key, 'We')
|
if search(a:key, 'We')
|
||||||
return "\<Right>"
|
return "\<Right>"
|
||||||
endif
|
endif
|
||||||
@ -230,6 +226,7 @@ endf
|
|||||||
|
|
||||||
" Fast wrap the word in brackets
|
" Fast wrap the word in brackets
|
||||||
func! AutoPairsFastWrap()
|
func! AutoPairsFastWrap()
|
||||||
|
let c = @"
|
||||||
normal! x
|
normal! x
|
||||||
let [before, after] = s:getline()
|
let [before, after] = s:getline()
|
||||||
if after[0] =~ '\v[\{\[\(]'
|
if after[0] =~ '\v[\{\[\(]'
|
||||||
@ -239,6 +236,7 @@ func! AutoPairsFastWrap()
|
|||||||
normal! e
|
normal! e
|
||||||
normal! p
|
normal! p
|
||||||
end
|
end
|
||||||
|
let @" = c
|
||||||
return ""
|
return ""
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user