From f447d486c9485d0f0da5ddbb2736105a23a5bbe8 Mon Sep 17 00:00:00 2001 From: "jiangfriend@gmail.com" Date: Sun, 13 Nov 2011 16:47:49 +0800 Subject: [PATCH] Optimize delete in pair --- plugin/auto-pairs.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index 3261f84..6d7caaf 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -99,7 +99,8 @@ function! AutoPairsDelete() if has_key(g:AutoPairs, prev_char) let close = g:AutoPairs[prev_char] if match(line,'^\s*'.close, col('.')-1) != -1 - return "\\cf".close + let space = matchstr(line, '^\s*', col('.')-1) + return "\". repeat("\", len(space)+1) end end