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

Feature request: Match next object on line if none under cursor #5248

Closed
dxmh opened this issue Dec 21, 2022 · 2 comments
Closed

Feature request: Match next object on line if none under cursor #5248

dxmh opened this issue Dec 21, 2022 · 2 comments
Labels
C-enhancement Category: Improvements

Comments

@dxmh
Copy link
Contributor

dxmh commented Dec 21, 2022

Currently, in order to use the Match commands like mi and ma, the cursor needs to be on/within the object you're trying to match.

It would be nice if the cursor would jump to the next match if there is no match under the cursor.

This would provide an enhanced user experience, consistent with how vim-surround behaves, and consistent with how Helix can increment/decrement numbers without being under the cursor (since #1778).

Example of desired behaviour, shown in vim using vim-surround, when the cursor is at the start of the line, vi" visually selects inside the quotes:

vim

Example of current behaviour in Helix, when the cursor is at the start of the line, mi" does not match inside the quotes:

helix0

@dxmh dxmh added the C-enhancement Category: Improvements label Dec 21, 2022
@Ordoviz
Copy link
Contributor

Ordoviz commented Dec 22, 2022

This request was rejected in #3871 because Helix's keybindings favor predictability over terseness.

@dxmh
Copy link
Contributor Author

dxmh commented Dec 22, 2022

Ah, thank you for pointing that out @Ordoviz. I wasn't aware of #3871.

@the-mikedavis also mentioned on the Matrix space:

There's a PR working to remove that behavior from C-a/C-x #4123. Jumping to the next object really complicates the behavior when you're using multiple selections and complicates the code a bunch. In general you can use textobjects like ]f to jump to the next textobject instead of this automatic jumping behavior

@dxmh dxmh closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants