Vim: The extension does not respect vscode's selection
Environment:
- VSCode Version: 1.12.2
- VsCodeVim Version: 0.8.4
- OS: Linux
What happened:
Using editor.action.smartSelect.grow
to selection a string, then press c
, it does not modify the whole selected text.
What did you expect to happen: The whole selected text should be modified. (Actually when I selection anything it is expected to enter visual mode. However it remains in normal mode. Even if I enter visual mode manually before executing editor.action.smartSelect.grow
, the extension does not respect the selection.)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 21
- Comments: 22 (11 by maintainers)
Same issue for me with
Expand Selection
, a workaround for me is to pressv
immediately after the expansion and VS Code’s selection turns into VsCodeVim’s.Ideally, for me, VsCodeVim would respect the selection and enter visual mode automatically
I’m looking into this. If I find anything worth developing I’ll post here.
Yeah I tried forcing the vscode cursor to the right of the character but that made it flicker all over the place. I thought of using a timeout to only correct the vscode selection when the user stopped dragging but that doesn’t feel like a good idea either.
The part of keeping the pressed character selected I think it’s doable. When I did that I haven’t created the lag behind and same selection checks so I was having a few issues with it moving the anchor sometimes. But now with those logics in place it might work better. When I have some time I’ll try that and make another PR for that.
I’ve made a fix for this with PR #5015. Since this change has to be tested manually I would really appreciate someone testing that PR and giving their feedback before it gets merged.
I also found a few other things that I would like to change/fix with selections but since I didn’t want the PR to get bloated I didn’t put them there. But here are some of the things I think could be done:
The things to note here are:
Note: The changes in this gif are not present on the mentioned PR. Its just some WIP I’ve been looking into.
I’ve been playing with our handling of selections recently. Some improvements have been made, but it’s still pretty insane. In our defense, it’s HARD, mostly because VSCode and vim have fundamentally different understandings of what constitutes a selection, and when A Thing happens to change the selections, VSCode likes to let us infer what happened based on incomplete information.
Anyway, if any brave soul does want to have some fun by poking around this stuff, let me know beforehand.