mirror of
https://github.com/jiangmiao/auto-pairs.git
synced 2025-04-21 20:18:48 +08:00
feat: Also add equal-pair-detecting check when deleting pairs
This commit is contained in:
parent
4f1c46b84a
commit
9984b255c0
10
README.md
10
README.md
@ -99,6 +99,16 @@ Features
|
||||
|
||||
---
|
||||
|
||||
input:
|
||||
((|)
|
||||
|
||||
(press <BS> at |)
|
||||
|
||||
output:
|
||||
(|)
|
||||
|
||||
---
|
||||
|
||||
input:
|
||||
|]]
|
||||
|
||||
|
@ -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*
|
||||
|
@ -342,6 +342,11 @@ func! AutoPairsDelete()
|
||||
return "\<BS>"
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user