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

Git Beta: File and line focus is lost when triggering git diff from the editor #26294

Open
andreasvh-conceto opened this issue Mar 7, 2025 · 0 comments
Labels
git Git integration feedback

Comments

@andreasvh-conceto
Copy link

Summary

After creating/modifying multiple files in a git repo and executing the git:diff command from the editor, the diff view opens but does not retain the original file and cursor position. This can cause confusion and disrupts workflow context.

Information: I use vim mode. But the error should be reproducable even without using vim mode.

Steps to trigger the problem:

  1. Open a git project
  2. Add the following files with (filename and order of the creation could be relevant) and write some text with several lines inside, save each of them a.txt, c.txt , b.txt.
  3. Go to the b.txt file and place the cursor somewhere in the middle in a line

Image

  1. Execute the git:diff command and look, where the cursor is placed

Actual Behavior:
The git diff view opens, but the last file in the git diff list is focused.
Image

Expected Behavior:
When the git diff view opens, the cursor should retain focus on the original file and line position in the editor from which the git:diff command was triggered.

Image

Zed Version and System Specs

Zed: v0.176.3 (Zed)
OS: macOS 15.3.1
Memory: 16 GiB
Architecture: aarch64

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log

@andreasvh-conceto andreasvh-conceto added the git Git integration feedback label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git Git integration feedback
Projects
None yet
Development

No branches or pull requests

1 participant