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

In normal mode selection has one extra character due to the cursor position #3661

Open
germtb opened this issue Apr 7, 2019 · 1 comment

Comments

@germtb
Copy link

germtb commented Apr 7, 2019

Describe the bug
When setting a selection programatically n an editor in normal mode the cursor is incorrectly positioned, which causes problems for other commands (e.g. copy).

To Reproduce
Change an editor selection programatically while in normal mode:

editor.selection = new vscode.Selection(
        start.line,
        start.character,
        end.line,
        end.character
);

See that the cursor is at the last character

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
Selection in normal mode places the cursor on the character before to the last.

Screenshots
Selection in normal mode:
Screen Shot 2019-04-07 at 2 39 46 PM

Selection works fine without vim extension, and in insert mode:
Screen Shot 2019-04-07 at 2 40 36 PM

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.3.0
  • VSCode version: 1.3.3
  • OS: Mojave 10.14.3

Additional context
I encountered this when writing my own plugin: https://github.com/germtb/vscode-token-navigation

@stevenguh
Copy link
Contributor

This might be a duplicate of #1806

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

2 participants