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

Fixes #1400, #612, #1632, #1634, #1531, #1458: Tab isn't handled properly for insert and visualblockinsert modes #1663

Merged
merged 26 commits into from
May 13, 2017

Conversation

Chillee
Copy link
Member

@Chillee Chillee commented May 6, 2017

So really, what I was doing in these commits was refactoring Visual Block Mode to use multicursors instead, where I also added my own code for handling Insert Mode Tab.

http://vimdoc.sourceforge.net/htmldoc/visual.html#blockwise-operators

Thus, this PR fixes (some of) #776, fixes #1400, fixes #612, fixes #1458, and fixes #1634.

I also added fixing #1531 into this one since its editing is a similar concept to visualblock.

@Chillee Chillee changed the title Fixes #1400: Tab doesn't work properly in visual blockmode Fixes #1400, #612, #1632, #1634: Tab isn't handled properly for insert and visualblockinsert modes May 6, 2017
@Chillee Chillee changed the title Fixes #1400, #612, #1632, #1634: Tab isn't handled properly for insert and visualblockinsert modes Fixes #1400, #612, #1632, #1634, #1531: Tab isn't handled properly for insert and visualblockinsert modes May 8, 2017
@Chillee Chillee changed the title Fixes #1400, #612, #1632, #1634, #1531: Tab isn't handled properly for insert and visualblockinsert modes Fixes #1400, #612, #1632, #1634, #1531, #1458: Tab isn't handled properly for insert and visualblockinsert modes May 8, 2017
@johnfn
Copy link
Member

johnfn commented May 9, 2017

Wow, this is great! Is it ready to go?

@Chillee
Copy link
Member Author

Chillee commented May 9, 2017

@johnfn Should be. I just realized that this PR actually also contains this PR: #1659, but that PR should also be fairly uncontroversial.

Lemme add a couple of tests for the new o/O functionality, and then I'd be fine with this being merged.

@Chillee
Copy link
Member Author

Chillee commented May 9, 2017

@johnfn Alright just added tests. It should be ready to merge.

@Chillee
Copy link
Member Author

Chillee commented May 10, 2017

This is a very bizarre bug.

This is the test that's failing:

|foo

with the keys yyO<esc>p.
This results in


foo
|foo

(this is because of the cursor position; it's not skipping a line when it pastes. For example, if bar was in the register, it would be


bar
|foo

).

The bizarre part about this is that if the cursor is like this before the O:

f|oo

it works fine. Looking at the returned vimState between the two cases, they look identical.

@Chillee
Copy link
Member Author

Chillee commented May 10, 2017

I feel like it has to be an upstream issue, with how weird this bug is. It has nothing to do with O itself: If you enter a line above with ctrl+shift+enter, it still has the same bug.

@Chillee
Copy link
Member Author

Chillee commented May 10, 2017

I ended up fixing it by moving the cursor to the right before calling editor.action.insertLineBefore

@@ -462,7 +456,7 @@ class CommandEsc extends BaseCommand {
}

if (vimState.currentMode === ModeName.EasyMotionMode) {
// Escape or other termination keys were pressed, exit mode
// Escaape or other termination keys were pressed, exit mode
Copy link
Member

Choose a reason for hiding this comment

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

typo

@johnfn
Copy link
Member

johnfn commented May 13, 2017

Is this good to go now? 😁

@Chillee
Copy link
Member Author

Chillee commented May 13, 2017

Except for that typo...

@johnfn johnfn merged commit b7c533b into VSCodeVim:master May 13, 2017
@johnfn
Copy link
Member

johnfn commented May 13, 2017

The cool thing is that as a contributor I can fix that directly from GitHub. Here we gooo

@Chillee
Copy link
Member Author

Chillee commented May 13, 2017

The reason I didn't say I completely fixed that refactor issue is that there's some visual block code I still haven't touched, related to visual block mode not in insert.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants