helix icon indicating copy to clipboard operation
helix copied to clipboard

`A-n`, `A-p`, `A-o`, `A-i` all don't have have consistent selection "orientations"

Open emilyyyylime opened this issue 1 year ago • 2 comments

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.

emilyyyylime avatar Nov 06 '22 03:11 emilyyyylime

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 avatar Nov 06 '22 14:11 the-mikedavis

@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

emilyyyylime avatar Nov 07 '22 04:11 emilyyyylime