From 7f548cbb180ee223830cd8da4689a7a19657dc17 Mon Sep 17 00:00:00 2001 From: Yang Tang Date: Wed, 17 Feb 2016 13:42:20 -0500 Subject: [PATCH] Don't break undo with left/right cursor movement. --- plugin/auto-pairs.vim | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index 0ffaf9a..94527c8 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -105,13 +105,13 @@ function! AutoPairsInsert(key) " Skip the character if current character is the same as input if current_char == a:key - return "\" + return "\U\" end if !g:AutoPairsFlyMode " Skip the character if next character is space if current_char == ' ' && next_char == a:key - return "\\" + return "\U\\U\" end " Skip the character if closed pair is next character @@ -132,7 +132,7 @@ function! AutoPairsInsert(key) " Fly Mode, and the key is closed-pairs, search closed-pair and jump if g:AutoPairsFlyMode && has_key(b:AutoPairsClosedPairs, a:key) if search(a:key, 'W') - return "\" + return "\U\" endif endif @@ -144,7 +144,7 @@ function! AutoPairsInsert(key) let close = b:AutoPairs[open] if current_char == close && open == close - return "\" + return "\U\" end " Ignore auto close ' if follows a word @@ -159,7 +159,7 @@ function! AutoPairsInsert(key) let pprev_char = line[col('.')-3] if pprev_char == open && prev_char == open " Double pair found - return repeat(a:key, 4) . repeat("\", 3) + return repeat(a:key, 4) . repeat("\U\", 3) end end @@ -194,7 +194,7 @@ function! AutoPairsInsert(key) endif endif - return open.close."\" + return open.close."\U\" endfunction function! AutoPairsDelete() @@ -318,10 +318,10 @@ function! AutoPairsFastWrap() else call search(s:FormatChunk(followed_open_pair, followed_close_pair), 'We') end - return "\".inputed_close_pair."\" + return "\U\".inputed_close_pair."\U\" else normal he - return "\".current_char."\" + return "\U\".current_char."\U\" end endfunction @@ -388,7 +388,7 @@ function! AutoPairsSpace() let cmd = '' let cur_char =line[col('.')-1] if has_key(g:AutoPairsParens, prev_char) && g:AutoPairsParens[prev_char] == cur_char - let cmd = "\\" + let cmd = "\\U\" endif return "\".cmd endfunction