helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
32.53k stars 2.4k forks source link

Increase Jumplist points when using the search #2930

Closed Philipp-M closed 5 months ago

Philipp-M commented 2 years ago

Related #1625 and #1718

I often find myself pressing n and N and want to go back again with C-o (probably after editing something).

But mostly I get lost then, because I land somewhere else (when search was initiated) I had a short discussion in #1718, but honestly I'm not super happy currently with the behavior of the search + jumplist.

Describe your feature request

I would propose that we push to the jumplist as soon as the user presses n or N after the user has moved (changed the selection) in between initiating the search or previously pressing n/N

the-mikedavis commented 2 years ago

I think you might be able to rebind n/N to ["save_selection", "search_next"] (and search_prev) as a workaround. Saving to the jumplist might add a lot of entries for every n/N - I think it would be ideal if it only saved to the jumplist on the last n/N, although that behavior could be too complicated or unpredictable 🤔

rcorre commented 1 year ago

FWIW, I don't think adding an entry on every n/N is too much, and saving only on the last does feel like it would be confusign.

Philipp-M commented 1 year ago

FWIW, I don't think adding an entry on every n/N is too much

The more I'm using the recommended rebinding, the more I agree with the others, that having a jumplist point at each n/N is a little bit too much, I often keep spamming C-o or C-i and get confused at that as well... Maybe I come around and implement my initial proposal, and try it out if the behavior is less confusing.

It may also make sense to be able to configure the jumplist a little bit via the config to each liking (how often, or when a new point should be added or something like that).

I think it would be ideal if it only saved to the jumplist on the last n/N, although that behavior could be too complicated or unpredictable

Yes that's pretty much what my intention is with my initial proposal (you have to somehow check when the user has pressed the last n/N)

the-mikedavis commented 1 year ago

I think there might be some overlap with this and #1596 (https://github.com/helix-editor/helix/issues/1596#issuecomment-1414198704) - being able to undo selections might solve this use-case rather than tuning the jumplist points. I'm curious how search selections behave with Kakoue since Kakoune recently implemented selection undos.