-
Notifications
You must be signed in to change notification settings - Fork 179
Fix shift selection in vi (insert) & emacs mode #927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thanks, that seems similar but clearer than the solution by Claude #911 . Noticed one minor issue, steps to reproduce:
|
Yeah, you're totally right; I missed this test case. Should be fixed now, all the modes seem to work for me. |
Your last commit didn't change anything in my setup. Say I have |
There's another complication: inconsistent behavior of selection in vi normal mode triggered by |
Okay I pushed up a commit that actually does fix it. My prior one did fix shift selection going leftwards but seems to have just shifted the issue to being present moving to the right for vi normal mode + cut operations. This new commit fixes it for both, but adds some complexity that I don't love. The core issue is that when we perform the cut operation, we immediately go into insert mode which then messes up the calculation for text to delete. Since we're in insert mode, it selects one character short even though the selection was made with vi normal mode. Let me know what you think of this. Also, I'm not sure exactly what you're referring to with:
From my experience, I can't even get the two to behave the same on a fresh build of the main branch. It seems that shift selection for vi normal mode has some other bug that makes it operate inconsistently with the cut and other operations. |
Yeah, probably rooted elsewhere. OMG... |
I used to take this issue to test AI agents' capabilities, haha. Never found one that's good enough. Claude 4.0 >> Gemini 2.5 pro on this issue, but still lame. |
Yeah since I'm new to this repo claude 4 has helped out with some of this but ultimately I'm having to babysit it pretty aggressively. Keeps wanting to implement hacky one-off fixes. |
Any movement on this? |
This PR fixes shift selection in vi (insert) & emacs mode. The gist is that we were incorrectly selecitng an additional character when selecting leftwards (holding shift and pressing left arrow). One extra character to the right of the start location was getting highlighted and would be affected by any delete or other operations.
Tested on macOS with both vi & emacs mode. No regression of vi (normal) shift selection functionality.
Fix for this issue: #922 which I think is a duplicate of #893.