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

vim vg0, vg^ and vg$ should include the character at the end of the line in the selection #9802

Closed
Tyriar opened this issue Jul 26, 2016 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) VIM VIM issue

Comments

@Tyriar
Copy link
Member

Tyriar commented Jul 26, 2016

Not sure if this is an extension, sample extension or API issue?

Steps to Reproduce:

  1. Open a file
  2. Go to a line with content
  3. end
  4. Type vg0, notice the character at the end is not included in the selection (unlike when running vim)
    image

And

  1. Go to beginning 0
  2. Type vg$, notice that character at the end is not included

And

  1. Go to beginning 0
  2. Type vg_, notice that non white space character at the end is included, BUT, cursor position is on next character
@Tyriar Tyriar added the bug Issue identified by VS Code Team member as probable bug label Jul 26, 2016
@Tyriar Tyriar changed the title vim vg0 should include the current character in the selection vim vg0 and vg^ should include the current character in the selection Jul 26, 2016
@kieferrm kieferrm added the VIM VIM issue label Jul 26, 2016
@rebornix
Copy link
Member

Same case as #9803. Thanks @Tyriar

@sandy081
Copy link
Member

This is a different issue than #9803. All selection commands are excluding the last character.

@sandy081 sandy081 reopened this Jul 27, 2016
@sandy081 sandy081 added this to the July 2016 milestone Jul 27, 2016
@sandy081 sandy081 changed the title vim vg0 and vg^ should include the current character in the selection vim vg0, vg^ and vg$ should include the character at the end of the line in the selection Jul 27, 2016
@sandy081
Copy link
Member

Again these are Vim specific details which has to be implemented by Vim extensions. Because, Vim extension uses Block cursor type for Normal (and Visual mode). Relation between Block type cursor and Line type cursor is that

  • To represent current character or column, Line cursor type blinks before it where as block type cursor blinks on top of the character

For eg: ab|c <==> block cursor on top of c

All movement and selection operations are based on this fact. So, when selecting backwards it is expected to ignore the current character.

One more fact is that in Vim world, there is no special position for end of line, instead last character is represented as end. So when end or $ is pressed, Vim moves the cursor to last character. Hence by default vg0 or vg^ ignores first character if just calling cursorMove command. So Vim implementation has to handle selecting current character on top of calling this command.

Moving this to Vim sample extension

@sandy081
Copy link
Member

This issue was moved to microsoft/vscode-extension-samples#3

@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 27, 2016
@Tyriar Tyriar removed this from the July 2016 milestone Jul 27, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) VIM VIM issue
Projects
None yet
Development

No branches or pull requests

4 participants