-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Changing to normal mode when clicking is not clearing RecordedState #5719
Comments
Interestingly enough, I can't reproduce this with those steps, but I have seen the same sort of thing recently - I think a recent change might have uncovered another way of triggering this, but I'm not sure what that is, exactly. So probably putting it in |
@sql-koala that is a different issue I think. It happens because the I have a fix for that already. The problem is I've been working on implementing a new feature that has just kept growing and growing. I really don't know when to stop! 😓 (that fix happens to be in the middle of that, oops!) I really need to learn to start splitting everything, but the problem is that I'm implementing something and then realize: Oh! For this to work properly, I need to implement that other thing as well. And that goes on and on and it escalates pretty quickly. On the bright side, though, I might have just implemented keyboard selections with shifted keys, SelectMode, |
@J-Fields So upon looking further into this we can't make the change in I found another way to do this that I think it's better. We can separate a single click from a click selection or a double click selection. So what I'm doing is, when we get a single click we send a special key (
From what I've tested this seems to work pretty well. And that no.1 can be pretty good (when you are already holding the mouse in your hand. BTW, I know I haven't been helping much lately but I've had some busy weeks, sorry about that. However, remember when I said I was going to implement the shifted keys actions like mentioned here #5050 (comment)? Well... I started working on that by implementing The problem is that, because I was busy, I was working on this only a few bits at a time on different machines, so I kept amending a 'wip' commit, just to be able to synchronize the work between both machines. So now I'm going to have to split all changes on different commits (also along the way I might have made some simple fixes here and there that were bothering me... 😅 ) I will try to push a draft PR soon so you can try it out and then tell me if it is better to split it all up piece by piece or if we can agglomerate some things together. |
Describe the bug
Currently when vscode creates a selection (like when using the "Find" widget) we go to visual mode. If the user then presses escape on the widget or closes the widget we are still in visual mode and if we press escape or use an operator everything works fine. However if the user clicks somewhere to get out of the widget instead of pressing escape or closing the widget, then the
handleSelectionChange
function changes the mode to normal, however since there was no action executed theRecordedState
doesn't change and if we were on insert mode when calling the "Find" widget, theRecordedState
will still have the action that was used to go to insert mode on theactionsRun
.This was mentioned by @ElvenSpellmaker here #3372 (comment).
To Reproduce
Steps to reproduce the behavior:
i
ora
<C-f>
or call the "Find" widget from the command palletei
ora
to go to insert mode again and it fails...Expected behavior
The recorded state should be cleared when we change to normal mode after a mouse click.
Additional Context
@J-Fields We could simply clear the
vimState.recordedState
when changing mode after the click or we could add that logic to theVimState.setMode
function. Which one do you think it's better?The text was updated successfully, but these errors were encountered: