Fix #239 extra space in quotes

This commit is contained in:
Miao Jiang 2019-01-28 22:42:59 +08:00
parent b85ef9831e
commit 1c3f4c8171
2 changed files with 7 additions and 3 deletions

View File

@ -159,7 +159,7 @@ Options
-------
* g:AutoPairs
Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'}
Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''"}
* b:AutoPairs

View File

@ -13,7 +13,7 @@ end
let g:AutoPairsLoaded = 1
if !exists('g:AutoPairs')
let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '```':'```', '"""':'"""', "'''":"'''"}
let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '```':'```', '"""':'"""', "'''":"'''", "`":"`"}
end
if !exists('g:AutoPairsMapBS')
@ -410,8 +410,12 @@ func! AutoPairsSpace()
continue
end
if before =~ '\V'.open.'\v$' && after =~ '^\V'.close
if close =~ '\v^[''"`]$'
return "\<SPACE>"
else
return "\<SPACE>\<SPACE>".s:Left
end
end
endfor
return "\<SPACE>"
endf