Vim: Pasting after deleting a line leaves cursor in wrong position

Created on 10 Jan 2017  路  16Comments  路  Source: VSCodeVim/Vim

Please thumbs-up 馃憤 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.


What did you do?

dd shift-p escape

What did you expect to happen?

After pasting the line and hitting escape it should leave the cursor on the line that was pasted.

What happened instead?

The cursor is placed on the line underneath.

Technical details:

  • VSCode Version: 1.8.1
  • VsCodeVim Version: 0.4.10
  • OS: OS X 10.11.6
kinbug

All 16 comments

The issue is present in a number of variations. The common theme is pasting something with a newline at the end. After hitting escape it should leave the cursor on the pasted line.

Does esc have anything to do with it? P doesn't put you in insert mode.

Can you show me the text you're operating on that reproduces this?

Correct, P doesn't put you in insert mode. ESC should also have no effect on modes at this point. But if you do hit ESC, it moves your cursor down, which is unexpected.

Can you give me an example of some text that you ran ddP<esc> to see this behavior?

Do you have anything weird in your user settings? :P

Nah this is a fresh install of vscode with the extension. Here is some sample text:

1. foo
2. foo
3. bar
4. foo
5. foo

Placing the cursor on line 3 bar and then hitting d d P ESC results in your cursor being left on the 4th line foo instead of the bar that was pasted.

How weird; I can't reproduce that.

Could you do me a favor and download the latest Insiders build of Code and see if the bug still reproduces there?

Sure. Will report back with my findings.

Interesting! That does indeed fix it.

Ok I identified the issue and it isn't the Insiders build that fixed the issue, it is this setting:

"vim.useSolidBlockCursor": true

With it true, the issue is present. With it false the issue is not present.

Wow, super weird! Thanks for the report.

Huh, solid block cursor actually cause a LOT of bugs. Definitely worth investigating further. Also very strange.

Holy cow! I just want to say that is a really annoying and obscure bug.
Other than that, great product though!

I bet #1247 is related and #1279

I believe this is fixed by https://github.com/VSCodeVim/Vim/pull/1402. Please re-open if that's not the case. cc @Chillee

Sorry for the late response here, but I can confirm this is indeed fixed @jpoon @xconverge . Thanks!

@benlakey We've actually just removed vim.useSolidBlockCursor. It had very miniscule gains (the only thing was that it allowed to you have a blinking cursor in insert mode and a solid cursor in normal mode), and it slows down the extension a ton.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

waltiam picture waltiam  路  3Comments

gerardmrk picture gerardmrk  路  3Comments

liamdawson picture liamdawson  路  3Comments

spinningarrow picture spinningarrow  路  3Comments

orn688 picture orn688  路  3Comments