Skip to content
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

Insert mode's <C-o> doesn't work properly #4186

Closed
turara opened this issue Oct 17, 2019 · 1 comment
Closed

Insert mode's <C-o> doesn't work properly #4186

turara opened this issue Oct 17, 2019 · 1 comment

Comments

@turara
Copy link

turara commented Oct 17, 2019

Describe the bug
When you invoke a command that turns the mode to "Insert" after you invoke <C-o> in Insert mode (CommandOneNormalCommandInInsertMode), <Esc>/<C-o> won't turn the mode to "Normal".

To Reproduce
Steps to reproduce the behavior:

  1. Go to Insert mode
  2. Type <C-o>
  3. Type o, A, I, or any command that turns the mode to "Insert"
  4. Type some words
  5. Type <Esc> or <C-o>
  6. You are still in the Insert mode

Expected behavior
You go back to the Normal mode

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.11.2
  • VSCode version: 1.38.1
  • OS: macOS 10.14.6

Additional context

Related to #3074

Cause of the problem

I believe the following line is part of the cause although I couldn't figure out how to fix it.

ranAction = ranAction && vimState.currentMode === ModeName.Normal;

When you type "o" after <C-o>, ranAction will be false because vimState.currentMode is ModeName.Insert and vimState.returnToInsertAfterCommand won't turn to false (Step 2 and 3). Then when you type <Esc> (Step 5),

  1. CommandEscInsertMode.exec turns the mode to "Normal" (inside ModeHandler.runAction)
  2. ModeHandler.runAction turns the mode back to "Insert" immediately.
@turara turara changed the title CommandOneNormalCommandInInsertMode won't work properly Insert mode's <C-o> doesn't work properly Nov 5, 2019
@turara
Copy link
Author

turara commented Feb 4, 2020

Seems fixed in #4461

@turara turara closed this as completed Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant