Silverquark / dance

Make your cursors dance with Helix-like modal editing in VS Code.
https://marketplace.visualstudio.com/items?itemName=silverquark.dancehelix
ISC License
111 stars 12 forks source link

Expand/shrink selection command selects one extra character under the cursor #12

Open onvlt opened 1 year ago

onvlt commented 1 year ago

In Helix, there's an expand_selection (shrink_selection) command, which expands (shrinks) selection to parent syntax node. The equivalent command in VS Code editor.action.smartSelect.expand can be – if one changes some keybindings – made to behave quite like in Helix.

However, there's a glitch in VS Code that expand command with this extension installed expands selection to parent syntax node plus one extra character after the selection due to the fact that the cursor which is placed after the selection is one character wide and it is also part of the selection. This causes probems when you want to change/delete the selected portion of code

https://github.com/Silverquark/dance/assets/7478957/619ee6a2-71c8-4c72-bc1b-a8cc298e8650