helix icon indicating copy to clipboard operation
helix copied to clipboard

Allow cursor to go off-screen in (sticky) view mode

Open patrick-kidger opened this issue 2 years ago • 5 comments

First the use case: I find it pretty common to want to leave my cursor in a particular spot whilst writing some code, then scroll through the rest of the file to refresh my memory on something, and then pick up where I left off.

As best I can tell this, or something similar, isn't possible. Currently I can use the (sticky) view mode to move the view, but this unfortunately also moves the cursor when it gets too close to the edge.

I have noticed that when working with multiple cursors, all-but-one of these will actually stay in place when scrolling around the file in view/sticky-view mode; it's just the "main" cursor that moves. So at a technical level, I'm just thinking it would be nice to have the "main" cursor also respected this behaviour. Philosophically I feel like it's more desirable not to couple view and cursor together like this. And practically this would make scrolling through a file much easier! (I note that decoupled view and cursor like this is the typical behaviour in most IDEs.)

To better support this proposed change: when leaving (sticky) view mode, then by default I think it would be best to move the view back to the location of the cursor, and to add a (sticky) view mode command that instead moves the cursor to the view. (And possibly exits view mode as well.)

WDYT? Once again, hopefully not a poorly-thought-out change from a new user.

patrick-kidger avatar Apr 16 '22 11:04 patrick-kidger