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

y}p handles newlines incorrectly #1197

Closed
Cody157 opened this issue Dec 27, 2016 · 0 comments · Fixed by #1621
Closed

y}p handles newlines incorrectly #1197

Cody157 opened this issue Dec 27, 2016 · 0 comments · Fixed by #1621
Labels

Comments

@Cody157
Copy link

Cody157 commented Dec 27, 2016

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.


I'm going to give two variations that are handled incorrectly, but that I also expect might require separate logic.

Variation 1: Starting at the beginning of a line

What did you do?

|foo
fun

bar

where | marks the cursor position (and isn't actually a character),
press y}p

What did you expect to happen?

foo
|foo
fun
fun

bar

Notice that when cursor is at the beginning of the line, it treats it like a line copy and starts a new line when you paste. It also includes the newline after the second (final) line.

What happened instead?

f|foo
fun
oo
fun

bar

Here it starts pasting after the first character instead.

Variation 2: Starting in the middle of a line

What did you do?

f|oo
fun

bar

press y}p

What did you expect to happen?

fo|oo
funo
fun

bar

Notice that this does not copy the newline after the second (final) line.

What happened instead?

fo|oo
fun
o
fun

bar

Here it does copy the newline after the second (final) line.

I don't think I've ever personally used variation 2, but I checked how it was handled while comparing the first one, which I use fairly often.

Technical details:

  • VSCode Version: 1.8.1
  • VsCodeVim Version: 0.4.10
  • OS: OS X El Capitan Version 10.11.6
@johnfn johnfn added the kind/bug label Jan 1, 2017
Chillee added a commit to Chillee/Vim that referenced this issue May 1, 2017
xconverge added a commit that referenced this issue May 10, 2017
Fixes #1196, #1197: d}/y} not working correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants