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

[Fix] Transition between v,V,<C-v> is different with original Vim behavior #2581

Merged
merged 2 commits into from
Apr 30, 2018

Conversation

tyru
Copy link
Contributor

@tyru tyru commented Apr 29, 2018

What this PR does / why we need it

I expect the same behavior as original Vim :)

  • vv -> normal mode

  • VV -> normal mode

  • <C-v><C-v> -> normal mode

  • vV -> visual line mode

  • v<C-v> -> visual block mode

  • Vv -> visual (char) mode

  • V<C-v> -> visual block mode

  • <C-v>v -> visual (char) mode

  • <C-v>V -> visual line mode

Which issue(s) this PR fixes

I could not find the issue.

@xconverge
Copy link
Member

Ah this is a good one, very easy to see the difference in behavior between vscodevim and normal vim, thanks for the contribution and tests!

assertEqual(modeHandler.currentMode.name, ModeName.VisualLine);
});

test('<C-v><C-v> will back to normal mode', async () => {
Copy link
Member

@xconverge xconverge Apr 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance you can switch these to assert that we got into the correct mode as well? Not a big deal but might be a good idea

C-v...assert in visual block, C-v...assert back in normal etc

tyru added 2 commits April 30, 2018 12:00
* `vv` -> normal mode
* `VV` -> normal mode
* `<C-v><C-v>` -> normal mode

* `vV` -> visual line mode
* `v<C-v>` -> visual block mode
* `Vv` -> visual (char) mode
* `V<C-v>` -> visual block mode
* `<C-v>v` -> visual (char) mode
* `<C-v>V` -> visual line mode
@tyru tyru force-pushed the transition-between-v-shiftv-ctrlv branch from 38c0dd9 to 8c37beb Compare April 30, 2018 03:01
@tyru
Copy link
Contributor Author

tyru commented Apr 30, 2018

Fixed test and previous commit message a bit :)

@xconverge xconverge merged commit 057fab1 into VSCodeVim:master Apr 30, 2018
@xconverge
Copy link
Member

Thank you! This one is a no brainer!

@tyru tyru deleted the transition-between-v-shiftv-ctrlv branch April 30, 2018 04:45
@tyru
Copy link
Contributor Author

tyru commented Apr 30, 2018

Thanks! 😄

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

Successfully merging this pull request may close these issues.

2 participants