Files
neovim/test
zeertzjq 2bb426ce4a vim-patch:9.2.0443: GUI: cancelling save dialog overwrites or discards unnamed buffer (#39617)
Problem:  When closing gvim with an unsaved unnamed buffer, choosing
          "Yes" in the "Save changes?" dialog and then "Cancel" in the
          file selection dialog either silently writes the buffer to a
          file named "Untitled" (overwriting any existing file with
          that name) or discards the buffer altogether
          (vibs29, after v9.1.0265).
Solution: In dialog_changed(), if browse_save_fname() leaves the buffer
          without a file name, treat it as a cancel and return without
          saving.  Also stop clearing the modified flag in the restore
          path on write failure, so the unsaved changes are kept and
          the caller (e.g. gui_shell_closed()) can also cancel the
          close.  Pre-fill the file dialog with "Untitled" to match
          the preceding "Save changes to ..." prompt.  Add a test for
          the write-failure path (Hirohito Higashi).

fixes:  vim/vim#20132
closes: vim/vim#20143

https://github.com/vim/vim/commit/cf947e7ef09fc8a63f447b54b107585b8f3b7abe

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-05-06 08:19:30 +08:00
..
2026-04-22 18:25:07 -04:00
2026-04-22 18:25:07 -04:00