diff --git a/README.md b/README.md index ff8642e..be64843 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,16 @@ Features --- + input: + ((|) + + (press at |) + + output: + (|) + + --- + input: |]] diff --git a/doc/AutoPairs.txt b/doc/AutoPairs.txt index 4607797..4e7d91f 100644 --- a/doc/AutoPairs.txt +++ b/doc/AutoPairs.txt @@ -281,8 +281,9 @@ Jump to the next closed pair. Default: 1 -Detects when to close a pair by detecting the equality of pairs within the -current buffer. (This feature is not supported for multibyte pairs) +Detects when to close a pair and how to delete an existing pair by detecting the +equality of pairs within the current buffer. (This feature is not supported for +multibyte pairs) *g:AutoPairsShortcutBackInsert* diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index 537ca52..4d80e8a 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -342,6 +342,11 @@ func! AutoPairsDelete() return "\" end end + if strlen(open) == 1 && g:AutoPairsEqualPairDetection == 1 + if s:count(open) !=# s:count(close) + return s:backspace(b) + endif + endif return s:backspace(b).s:delete(a) end endfor