Vim: Copy after vi' is incorrect (last character missing)

Created on 19 Apr 2017  路  13Comments  路  Source: VSCodeVim/Vim

  • Click thumbs-up 馃憤 on this issue if you want it!
  • Click confused 馃槙 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Tried to copy text using ctrl+c after selecting a string between quotes.

s = "hello, world"

Position cursor anywhere between quotes. Press vi". Then press ctrl+c

What did you expect to happen?

hello, world in the clipboard`

What happened instead?

hello, worl in the clipboard

Technical details:

  • VSCode Version: 1.1.12
  • VsCodeVim Version: 0.6.16
  • OS: Ubuntu 16.04
kinbug

All 13 comments

confirmed on:
VSCode: 1.11.2
VsCodeVim: 0.6.17
OS: Fedora 24

In view mode on double click the selection missing the last char.
ex:
"helloword" on double click on w the selection is hellowor, i expected helloword

(in insert mode this is not happening)

Just wondering, are you guys setting vim.useCtrlKeys: true?

yes, otherwise, how do I copy to the system clipboard? Maybe there is a way to do it, but I don't know how @Chillee

I think it's definitely a bug (that I've run into a bunch as well), but I'm just trying to track it down.

Ok, so I think I found part of the issue.

https://github.com/VSCodeVim/Vim/blob/master/src/mode/modeHandler.ts#L765

That should capture the default ctrl+c and replace it with our "", which handles all those cases. However, when useCtrlKeys is false, it doesn't get to this code.

I'll root around a bit more for the issue.

However, if you set vim.useCtrlKeys to be true, you can also use cmd+d (for whatever your keyboard is) to copy, and that should give you the correct behavior.

@Chillee fixed it on master

i just installed version 0.6.20 and the things getting weird.
In insert mode everything is all right.
In view mode:

if a select a word visually the last character is missing, but if i do copy&paste the selection is complete and the character is not missing.
If a select a word and paste the last character is not overridden.

i create a gif of the problem to help you to understand:

peek 2017-04-26 10-11

This is as designed,

Let me add the relevant other issue numbers when I get a chance

why is what happens in his gif "as designed"? That's the #1 issue that makes it hard for me to switch full time to vscode over sublime text right now... in gvim it would not do that and it's really problematic. Is there no way to fix it?

Just trying to understand why this is closed as fixed when that issue still exists -- it's not a minor inconvenience, it's a constant pain making me feel like I need to disable vim mode.

I appreciate that you guys are doing this! Just trying to understand.

@taxilian Not so much designed as a limitation with the VSCode api (and our design choices).

This class of issues: https://github.com/VSCodeVim/Vim/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Fselection-off-by-one

is the type of problems that you're talking about.

Thanks for the explanation, Chillee, and also for a link to some other issues with more specific relevant info. I'll throw in my $0.02 in those =]

Thanks, sorry I was brief via mobile :)

Was this page helpful?
0 / 5 - 0 ratings