zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.47k stars 3.12k forks source link

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

Open Daste745 opened 6 hours ago

Daste745 commented 6 hours ago

Check for existing issues

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 ``` ```