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

Copy after vi' is incorrect (last character missing) #1533

Closed
Valve opened this issue Apr 19, 2017 · 13 comments
Closed

Copy after vi' is incorrect (last character missing) #1533

Valve opened this issue Apr 19, 2017 · 13 comments
Labels

Comments

@Valve
Copy link

Valve commented Apr 19, 2017

  • 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
@m47730
Copy link

m47730 commented Apr 20, 2017

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)

@Chillee
Copy link
Member

Chillee commented Apr 20, 2017

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

@Valve
Copy link
Author

Valve commented Apr 20, 2017

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

@Chillee
Copy link
Member

Chillee commented Apr 20, 2017

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.

@Chillee
Copy link
Member

Chillee commented Apr 20, 2017

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.

xconverge added a commit that referenced this issue Apr 21, 2017
@xconverge
Copy link
Member

@Chillee fixed it on master

@m47730
Copy link

m47730 commented Apr 26, 2017

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

@xconverge
Copy link
Member

This is as designed,

@xconverge
Copy link
Member

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

@taxilian
Copy link

taxilian commented Jun 5, 2017

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.

@Chillee
Copy link
Member

Chillee commented Jun 5, 2017

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

@taxilian
Copy link

taxilian commented Jun 5, 2017

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 =]

@xconverge
Copy link
Member

Thanks, sorry I was brief via mobile :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants