cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.09k stars 77 forks source link

Keyboard: Automatically target selection when moving the cursor with arrow keys or mouse #2396

Open colesam opened 1 month ago

colesam commented 1 month ago

Issue: When in cursorless mode, moving the primary cursor (box outline) with the arrow keys or mouse can sometimes leave the pink cursor in a previous location, resulting in unintuitive behavior. This often results in accidentally executing a command in some previous position. To get around this I find myself having to spam 'ctrl-c' to make sure the cursor is where I would expect it to be.

To fix this I propose that if the cursor is moved using the arrow keys or by clicking with a mouse, that the action cursorless.keyboard.targeted.targetSelection is run automatically to keep the cursorless cursor where the user would expect.

It would be good to cover all vscode actions that move the cursor, as I have ctrl-e mapped to go to the end of the line, ctrl-(hjkl) as the arrow keys, etc.