Skip to content

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

Closed

Description

@Tyriar

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

Activity

  1. added
    bug
    on Jul 26, 2016
  2. 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[/+] on Jul 26, 2016
  3. rebornix commented on Jul 27, 2016

    @rebornix
    Contributor

    Same case as #9803. Thanks Daniel Imms (@Tyriar)

  4. sandy081 commented on Jul 27, 2016

    @sandy081
    Member

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

  5. 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[/+] on Jul 27, 2016
  6. sandy081 commented on Jul 27, 2016

    @sandy081
    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

  7. sandy081 commented on Jul 27, 2016

    @sandy081
    Member

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

  8. added
    *duplicate
    on Jul 27, 2016
  9. removed this from the July 2016 milestone on Jul 27, 2016
  10. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicateVIMbug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions