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

Split goto-number functionality from increment/decrement into a textobject #3028

Closed
the-mikedavis opened this issue Jul 10, 2022 · 2 comments
Labels
A-helix-term Area: Helix term improvements C-discussion Category: Discussion or questions that doesn't represent real issues

Comments

@the-mikedavis
Copy link
Member

Increment (C-a) and decrement (C-d) currently move forward to the next number on their line if the cursor is not already over a number.

It would fit better with the select-then-act paradigm to split the motion and action behaviors. C-a and C-d can continue to increment and decrement but should not move the cursor. Increment/decrement should only act on the current selections. A new textobject ]n/[n/min/man could replace the motion.

The new textobject could use tree-sitter queries to find number specific to the current language and/or could use a default naive implementation like what we have in increment/decrement now. (Falling back to a naive implementation would only work if we can easily detect that a query does not have any number.inside/number.around captures. I think that should be possible to figure out without running the query.)

@the-mikedavis the-mikedavis added C-discussion Category: Discussion or questions that doesn't represent real issues A-helix-term Area: Helix term improvements labels Jul 10, 2022
@pascalkuthe
Copy link
Member

This was addressed by #4123 I think?

@the-mikedavis
Copy link
Member Author

I was thinking at the time that we might want new textobjects to make jumping to numbers easier. But with macro keybinding and possibly also #5672, new textobjects aren't necessary. So yep I consider this resolved 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-discussion Category: Discussion or questions that doesn't represent real issues
Projects
None yet
Development

No branches or pull requests

2 participants