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

Zed Y with partial selection is inconsistent with vim. #22388

Open
1 task done
alexeypetrenko opened this issue Dec 24, 2024 · 2 comments · May be fixed by #22416
Open
1 task done

Zed Y with partial selection is inconsistent with vim. #22388

alexeypetrenko opened this issue Dec 24, 2024 · 2 comments · May be fixed by #22416
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue

Comments

@alexeypetrenko
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Summary

While having some text selected, Y in zed yanks only the selected text. In Vim it yanks the whole line(lines)

Steps to reproduce

  1. Start with the following program:
fn main() {
    println!("Hello, world!");
}
  1. Havigate to the H
  2. Select a word with vw
  3. Yank with Y
  4. Paste with P

Result in zed:

fn main() {
    println!("Hello,Hello, world!");
}

Result in vim:

fn main() {
    println!("Hello, world!");
    println!("Hello, world!");
}

Other notes

I realize, this example is silly, but it is the shortest I came up with.

In real world I use similar moves with multiline selection (to clone whole functions):

  1. Go to the closing }
  2. v% to select the function body
  3. Yank the whole function with Y

It works in vim, but not in zed.

Zed Version and System Specs

Zed: v0.166.1 (Zed)
OS: macOS 14.7.0
Memory: 16 GiB
Architecture: aarch64

If applicable, add screenshots or screencasts of the incorrect state / behavior

Screenshot 2024-12-24 at 09 31 41

If applicable, attach your Zed.log file to this issue.

Zed.log

@alexeypetrenko alexeypetrenko added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Dec 24, 2024
@0x2CA
Copy link
Contributor

0x2CA commented Dec 25, 2024

There are better ways to copy a function, such as yif, yaf, yii, yaI.

About the issue of selecting text and using Y to copy the line that you mentioned, it indeed exists.

I found it implemented in past commit logs.

vim: Add :y #17448

But removing in this commit

vim: Command selection fixes #18424

But the code is left with the action VisualYankLine

@0x2CA 0x2CA linked a pull request Dec 25, 2024 that will close this issue
@alexeypetrenko
Copy link
Author

There are better ways to copy a function, such as yif, yaf, yii, yaI.

Thank you for these! They are faster and more convenient for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants