-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing a bracket removes more than one bracket #4544
Comments
This problem trips me up often too. |
When backward-deleting a character, if this character and the following character form a Pair, we want to delete both. However, there is a bug that deletes both characters also if both characters are closers of some Pair. This commit fixes that by adding an additional check that the deleted character should be an opener in a Pair. Closes helix-editor#4544.
#4558 is the change that fixes the issue. However, there is still a problem with AutoPairs: they are annotated to be keyed by the opener: helix/helix-core/src/auto_pairs.rs Lines 19 to 22 in 8ff92c7
but the new() method also adds closers as keys: helix/helix-core/src/auto_pairs.rs Lines 90 to 91 in 8ff92c7
This might be the issue why the bug was introduced in the first place - the contributor assumed that there are no closers in the list of keys of an AutoPairs instance. |
When backward-deleting a character, if this character and the following character form a Pair, we want to delete both. However, there is a bug that deletes both characters also if both characters are closers of some Pair. This commit fixes that by adding an additional check that the deleted character should be an opener in a Pair. Closes #4544.
When backward-deleting a character, if this character and the following character form a Pair, we want to delete both. However, there is a bug that deletes both characters also if both characters are closers of some Pair. This commit fixes that by adding an additional check that the deleted character should be an opener in a Pair. Closes helix-editor#4544.
When backward-deleting a character, if this character and the following character form a Pair, we want to delete both. However, there is a bug that deletes both characters also if both characters are closers of some Pair. This commit fixes that by adding an additional check that the deleted character should be an opener in a Pair. Closes helix-editor#4544.
When backward-deleting a character, if this character and the following character form a Pair, we want to delete both. However, there is a bug that deletes both characters also if both characters are closers of some Pair. This commit fixes that by adding an additional check that the deleted character should be an opener in a Pair. Closes helix-editor#4544.
Summary
In this short video, I delete a closing bracket, but it also removes the closing bracket to the right of it.
Schermopname.2022-10-31.om.20.14.09.mov
Reproduction Steps
type something like
(())
in helix. Remove the third bracket with backspace, the last one will disappear as well.Helix log
No response
Platform
macOS
Terminal Emulator
iTerm2
Helix Version
helix 22.08.1 (f41f28b)
The text was updated successfully, but these errors were encountered: