From 9d554d08be38a0e72ba3d67147041b1af54ea201 Mon Sep 17 00:00:00 2001 From: "jiangfriend@gmail.com" Date: Fri, 30 Dec 2011 16:05:37 +0800 Subject: [PATCH] fix close single quote incorrect --- plugin/auto-pairs.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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