diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index 3d0d8cc..307122c 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -78,12 +78,6 @@ function! AutoPairsInsert(key) return a:key end - " Ignore ' if follows a word - if a:key == "'" && prev_char =~ '\v\w' - return a:key - end - - if !has_key(g:AutoPairs, a:key) " Skip the character if next character is space if current_char == ' ' && next_char == a:key @@ -116,6 +110,12 @@ function! AutoPairsInsert(key) return "\" end + " Ignore auto close ' if follows a word + " MUST after closed check. 'hello|' + if a:key == "'" && prev_char =~ '\v\w' + return a:key + end + return open.close."\" endfunction