Vim: $ command takes newline in visual mode

Created on 8 Aug 2019  路  12Comments  路  Source: VSCodeVim/Vim

Describe the bug
When in visual mode, using the $ command should take you to the last character of a line, not including the new line, if present.

To Reproduce
Steps to reproduce the behavior:

  1. Go into visual mode.
  2. Use $ to go to the end of line, but end with the cursor on the next line.

Expected behavior
The expected behavior is stopping at the last character, that is not a new line.

Environment

  • Extension (VsCodeVim) version: v1.9.0
  • VSCode version: 1.36.1
  • OS: macos x 10.14.5
aremotion areselection kinbug

All 12 comments

A note: this feature works in normal mode. This issue is only with respect to visual mode.

Just wanted to second that I've seen this issue as well. Same circumstances, same behavior.

Environment

  • Extension (VSCodeVim) version: v1.9.0
  • VSCode Version: 1.37.0
  • OS: macOS 10.14.5

@stevenguh You're right, thanks for pointing that out. I'll fix that this afternoon.

@pattersongp I swear I replicated this in vanilla vim the other day, but now when I try v$ in vim, it _does_ include the EOL. We have tests for this case. Can you verify that this isn't actually how vim behaves?

v$ will include the EOL character for me in vanilla Vim

That video is already showing v$ including the new line character. Try using vg_ to see the difference.

You can see the difference if you enter two lines of text.
ggv$y and paste it somewhere
This will include a EOL
vs
ggvg_y and paste it somewhere
This will not include a EOL

Indeed, v$ will select the EOL as well (checked in neovim). The difference is only visual, in vim the cursor doesn't appear in the next line after v$, while in VSCodeVim it does.

I agree that the EOL is taken into the clipboard, but the cursor should not appear on the following line. Sorry-- the issue should be _cursor appears on next line after v$_

I think that's the limitation of VS Code, but I don't know enough to say for sure.

Yes, I believe this is not possible in VSCode. Another rendering limitation is that the block cursor is wider when on top of a tab character.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

typeoneerror picture typeoneerror  路  3Comments

lucastheisen picture lucastheisen  路  3Comments

elithrar picture elithrar  路  3Comments

stefanoio picture stefanoio  路  3Comments

jaredly picture jaredly  路  3Comments