Cursor selection status creates confusing interactions
Hello,
I'm finding that the behavior of trying to treat the character "under" the block cursor as "selected" without actually selecting it leads to some confusing interactions, a couple in particular I've run into with editor.action.addSelectionToNextFindMatch. In general, it also makes it confusing to interact with other vscode features/extensions that care about selected text.
For example if I wanted to change "old" in this text to "new" ( | represents cursor ):
"|old"
"old"
In insert mode I would do ⌘-d ⌘-d n e w, but from normal mode, ⌘-d ⌘-d modalEditor.cut produces:
"|
"|
This can be accommodated with a command like "w" as defined in the preset that ends with "cursorLeftSelect". w ⌘-d modalEditor.cut works as expected (though non-modalEditor commands such as editor.action.transformToUppercase don't work).
However, if you instead start with your cursor after the 'd' of the first 'old' and try b ⌘-d modalEditor.cut you get:
"|"
"|
I suspect vscode internally thinking of the cursor existing between characters means there's not a simple solution, but figured I'd ask just in case.
I don't quite understand the problem you are facing here and what you want to achieve. The keybinding for ⌘-d is not handled by modalEditor and I'm not sure what you bind it to. In helix, it should be bound to modalEditor.delete right?
Ah sorry that wasn't clear, ⌘-d is a binding for editor.action.addSelectionToNextFindMatch.
I see. It's indeed a problem as commands provided by VSCode assume that the range doesn't include the current cursor. There seems to be no perfect solution to that.
For such cases, I usually patch the original command by appending an extra command to move it on char left using modalEditor.executeCommand.