Fixes #228 ' is duplicated inside a word

This commit is contained in:
Miao Jiang 2019-01-16 10:07:05 +08:00
parent 8d2f838205
commit 43db4c1776

View File

@ -197,7 +197,7 @@ func! AutoPairsInsert(key)
return s:right(m) return s:right(m)
end end
end end
if open != close if a:key == g:AutoPairsWildClosedPair || open != close
let m = matchstr(after, '^\v\s*\zs\V'.close) let m = matchstr(after, '^\v\s*\zs\V'.close)
if m != '' if m != ''
" skip close pair greedy " skip close pair greedy
@ -315,7 +315,7 @@ func! AutoPairsFastWrap()
return "" return ""
end end
endfor endfor
if after[1:1] =~ '\v[a-zA-Z0-9_]' if after[1:1] =~ '\v\w'
normal! e normal! e
normal! p normal! p
else else
@ -441,6 +441,9 @@ func! AutoPairsInit()
" buffer level map pairs keys " buffer level map pairs keys
for [open, close] in items(b:AutoPairs) for [open, close] in items(b:AutoPairs)
if open == close && open == "'"
let open = '\v(^|\W)\zs'''
end
let o = open[len(open)-1] let o = open[len(open)-1]
let m = matchlist(close, '\v(.*)//(.*)$') let m = matchlist(close, '\v(.*)//(.*)$')
let mapclose = 1 let mapclose = 1