Merge 79ce87888451e93a5e2b853be3724c59b479c281 into 39f06b873a8449af8ff6a3eee716d3da14d63a76

This commit is contained in:
Michael Quinn 2019-08-11 12:33:26 +00:00 committed by GitHub
commit 4bf8ad3db1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -241,6 +241,13 @@ Options
Work with FlyMode, insert the key at the Fly Mode jumped postion
* g:AutoPairsIgnoreCharacters
Default : ['\']
Sets the characters to stop auto closing. For example, when set to
['\', '#'], the plugin will not automatically close `#'`
* g:AutoPairsMoveCharacter
Default: "()[]{}\"'"

View File

@ -100,6 +100,10 @@ if !exists('g:AutoPairsSmartQuotes')
let g:AutoPairsSmartQuotes = 1
endif
if !exists('g:AutoPairsIgnoreCharacters')
let g:AutoPairsIgnoreCharacters = ['\']
endif
" 7.4.849 support <C-G>U to avoid breaking '.'
" Issue talk: https://github.com/jiangmiao/auto-pairs/issues/3
" Vim note: https://github.com/vim/vim/releases/tag/v7.4.849
@ -204,8 +208,8 @@ func! AutoPairsInsert(key)
let [before, after, afterline] = s:getline()
" Ignore auto close if prev character is \
if before[-1:-1] == '\'
" Ignore auto close if prev character is in g:AutoPairsIgnoreCharacters
if index(g:AutoPairsIgnoreCharacters, prev_char) != -1
return a:key
end
@ -332,7 +336,6 @@ func! AutoPairsDelete()
return "\<BS>"
endf
" Fast wrap the word in brackets
func! AutoPairsFastWrap()
let c = @"