helix
helix copied to clipboard
`A-n`, `A-p`, `A-o`, `A-i` all don't have have consistent selection "orientations"
What I mean by the selections' orientation is the relative order of the cursor and the anchor.
I think it's important for movement operations to be consistent in their orientation because it lets me better string together multiple operations without having to actively look out for where my cursor is.
Furthermore, if I'm using A-n
etc. to navigate the document I usually want/expect the object I'm moving into to come into focus, while the current behaviour seems to "prefer" not moving document around at all.
The current behavior is to inherit the direction from the original selection: https://github.com/helix-editor/helix/blob/4ec2a21c6e21ab4e515f1bd7ee1049094af2a6b2/helix-core/src/object.rs#L70-L74
What's the behavior you're looking for?
@the-mikedavis I think next sibling and prev sibling should always be forwards and backwards, respectively.
I guess I don't actually care about direction when both nodes are on screen at once but if I'm going to a node that's mostly off-screen (say from one top-level function to the next), I'd want it to become mostly on screen, not just to see a little sliver of it selected