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

dot command does not work properly when inserting <Tab>/"/'/(/{/[ #1674

Closed
o-lim opened this issue May 8, 2017 · 2 comments
Closed

dot command does not work properly when inserting <Tab>/"/'/(/{/[ #1674

o-lim opened this issue May 8, 2017 · 2 comments

Comments

@o-lim
Copy link

o-lim commented May 8, 2017

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


BUG REPORT

Environment:

  • VSCode Version: 1.12.x
  • VsCodeVim Version: 0.7.0
  • OS: Linux

Failure mode for tabs as spaces with the dot command:

What happened:

  1. Press i to enter insert mode
  2. Press <Tab> to insert tabs as spaces
  3. Press <ESC> to exit insert mode
  4. Press . to repeat the last command

What did you expect to happen:

  • Insert another <Tab> (as spaces)

What happened instead:

  • Cursor moves left one character and nothing was inserted

Failure mode for inserting " (double quote) with the dot command (the same behavior happens when inserting any of the following chars (, {, ', [):

What happened:

  1. Go to the first line of an indented paragraph
  2. Press i to enter insert mode
  3. Press " (double quote), to insert a double quote
  4. Press <ESC> to exit insert mode
  5. Go down one line by pressing j
  6. Press . to repeat the last command
  7. Go down one line by pressing j
  8. Press . to repeat the last command yet again

What did you expect to happen:

  • Insert a " (double quote) to the beginning of the next line

What happened instead:

  • Cursor moves left one character each time the "dot" command is used
    • This causes the insertion of the next " (double quote) to be in the wrong place
@Chillee
Copy link
Member

Chillee commented May 8, 2017

The first part is a duplicate of #612 , which is also fixed by PR #1663 .

The second one is strange, I'll take a look later.

@Chillee
Copy link
Member

Chillee commented May 8, 2017

This is the part of code that's causing issues for the second problem.
https://github.com/VSCodeVim/Vim/blob/master/src/mode/modeHandler.ts#L895

It's not always true that vscode will insert a paired character. It depends on context.

Chillee added a commit that referenced this issue May 21, 2017
Fixes #1674: repeating . with characters like " or ) leaves cursor in wrong place
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants