Skip to content
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

Do not always delete empty pairs on <BS> #266

Open
Emilgardis opened this issue Nov 28, 2017 · 0 comments
Open

Do not always delete empty pairs on <BS> #266

Emilgardis opened this issue Nov 28, 2017 · 0 comments

Comments

@Emilgardis
Copy link

Emilgardis commented Nov 28, 2017

When chaining delimiters, e.g (foo(bar)), and then at (foo(bar)|) you press backspace to remove foo(bar)you end up with (|, but what you really wanted was (|).

This is sometimes a huge annoyance when having many delimiters and keeping track of how many open delimiters there are.

I propose a feature similar to balance_matchpair that keep track of opening pairs, and tries to only remove empty pairs when there is an even amount of pairs.

One problem with this is of course how to handle cases like the following rust code

let x: A<B<C>|> = foo(2 > 1);

here when we arrive at let x: A<B<|> = 2 > 1; we do have an even amount of delimiters, as such the correct behaviour would be to remove the empty pair, even if what we really wanted was to only remove the <. Now, we could make it so that we only check the left side, but I doubt that would fix anything. I'm not sure if this could be implemented (and I could always just use "_di) or "_di( but it'd sure be a nice addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant