Skip to content

Commit

Permalink
Fix jiangmiao#239 extra space in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangmiao committed Jan 28, 2019
1 parent b85ef98 commit 1c3f4c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Options
-------
* g:AutoPairs

Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'}
Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''"}

* b:AutoPairs

Expand Down
8 changes: 6 additions & 2 deletions plugin/auto-pairs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end
let g:AutoPairsLoaded = 1

if !exists('g:AutoPairs')
let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '```':'```', '"""':'"""', "'''":"'''"}
let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '```':'```', '"""':'"""', "'''":"'''", "`":"`"}
end

if !exists('g:AutoPairsMapBS')
Expand Down Expand Up @@ -410,7 +410,11 @@ func! AutoPairsSpace()
continue
end
if before =~ '\V'.open.'\v$' && after =~ '^\V'.close
return "\<SPACE>\<SPACE>".s:Left
if close =~ '\v^[''"`]$'
return "\<SPACE>"
else
return "\<SPACE>\<SPACE>".s:Left
end
end
endfor
return "\<SPACE>"
Expand Down

0 comments on commit 1c3f4c8

Please sign in to comment.