fix close single quote incorrect

This commit is contained in:
jiangfriend@gmail.com 2011-12-30 16:05:37 +08:00
parent 7e4614d6aa
commit 9d554d08be

View File

@ -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 "\<Right>"
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."\<Left>"
endfunction