Insert open brackets when current bracket is open bracket.
OLD: |[] + [ => [|] |"" + " => "|" NOW: |[] + [ => [|][] |"" + " => "|"
This commit is contained in:
parent
33e6d1e312
commit
8d48d95dd8
@ -36,7 +36,7 @@ function! AutoPairsInsert(key)
|
||||
end
|
||||
|
||||
" Skip the character if current character is the same as input
|
||||
if current_char == a:key
|
||||
if current_char == a:key && !has_key(g:AutoPairs, a:key)
|
||||
return "\<Right>"
|
||||
end
|
||||
|
||||
@ -48,6 +48,10 @@ function! AutoPairsInsert(key)
|
||||
let open = a:key
|
||||
let close = g:AutoPairs[open]
|
||||
|
||||
if current_char == close && open == close
|
||||
return "\<Right>"
|
||||
end
|
||||
|
||||
|
||||
" Auto return only if open and close is same
|
||||
if prev_char == open && open != close
|
||||
|
Loading…
Reference in New Issue
Block a user