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

Vim mode :wq doesn't save a buffer if it's open in another pane #21059

Open
1 task done
Daste745 opened this issue Nov 22, 2024 · 3 comments
Open
1 task done

Vim mode :wq doesn't save a buffer if it's open in another pane #21059

Daste745 opened this issue Nov 22, 2024 · 3 comments
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue

Comments

@Daste745
Copy link
Contributor

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When a buffer is open in multiple panes using the :wq vim mode command doesn't perform a save. :wq only saves when a buffer is the last one to be quit.

This is an issue for me mainly when renaming symbols accross the project. It only surfaces when all affected files are already open as panes. When I perform a rename, "accept" it by running :wq, I'd expect all files in the "rename x -> y" multibuffer to be saved regardless if they are already open elsewhere. I'm guessing it's the same scenario where all files open in the multibuffer are open in other buffers causing the save action to be skipped.

Reproduction steps:

  1. Open a file
  2. Open the same file in another pane (e.g. a split)
  3. Use :wq to save and quit the file in one of the splits
  4. Observe the file not being saved

Reproduction (video):

Screencast_20241122_150111.webm

Environment

Zed: v0.161.2 (Zed)
OS: Linux Wayland endeavouros unknown
Memory: 22.3 GiB
Architecture: x86_64
GPU: AMD Radeon Graphics (RADV RENOIR) || radv || Mesa 24.2.6-arch1.1

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

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

Zed.log

@Daste745 Daste745 added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Nov 22, 2024
@nirs
Copy link

nirs commented Nov 23, 2024

I could not reproduce with Zed 0.162.4 on macOS 15.1.

What I did:

  1. open new file
  2. write one line
  3. save (:wq)
  4. split right
  5. change the line on the right pane
  6. save (:wq)

Both panes looks saved.

Maybe this is linux specific bug.

@Daste745
Copy link
Contributor Author

You saved the file before opening it in another pane @nirs, but the issue here is when the file is open in two panes at once and you do :wq in one of them. Expected behavior for me would be to save and quit the file in the right pane, but currently it only gets closed without any saving, leaving the file unsaved in the first pane.

I'm able to reproduce on MacOS, latest Zed version.

System specs
Zed: v0.162.5 (Zed)
OS: macOS 15.0.0
Memory: 16 GiB
Architecture: aarch64

@nirs
Copy link

nirs commented Nov 23, 2024

You saved the file before opening it in another pane @nirs, but the issue here is when the file is open in two panes at once and you do :wq in one of them.

The file was opened in both panes, and modified in the second pane. The difference is that I did save (:w) not save and quit (:wq). I can reproduce it now with (:wq).

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

No branches or pull requests

2 participants