diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-04-06 05:57:20 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-04-06 05:58:21 +0800 |
commit | dcf4c5744a9ad68e9cfe001b39706f914ba4c9da (patch) | |
tree | 68a21ccafba7df13e48d8c0974daa1061370c331 | |
parent | 66568ed4521972cd34d9f635511b979481e2dc01 (diff) | |
download | rneovim-dcf4c5744a9ad68e9cfe001b39706f914ba4c9da.tar.gz rneovim-dcf4c5744a9ad68e9cfe001b39706f914ba4c9da.tar.bz2 rneovim-dcf4c5744a9ad68e9cfe001b39706f914ba4c9da.zip |
vim-patch:9.1.0267: File name entered in GUI dialog is ignored
Problem: File name entered in GUI dialog is ignored (after v9.1.0265)
Solution: Only set file name to "Untitled" if GUI dialog didn't set it.
(zeertzjq)
closes: vim/vim#14417
https://github.com/vim/vim/commit/c20bdf1107d48a1c14713709d12d429e761132af
-rw-r--r-- | src/nvim/ex_cmds2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 898c3fb3f9..b7f4f269e1 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -203,7 +203,6 @@ void dialog_changed(buf_T *buf, bool checkall) .append = false, .forceit = false, }; - bool empty_buf = buf->b_fname == NULL; dialog_msg(buff, _("Save changes to \"%s\"?"), buf->b_fname); if (checkall) { @@ -213,7 +212,8 @@ void dialog_changed(buf_T *buf, bool checkall) } if (ret == VIM_YES) { - if (empty_buf) { + bool empty_bufname = buf->b_fname == NULL; + if (empty_bufname) { buf_set_name(buf->b_fnum, "Untitled"); } @@ -225,7 +225,7 @@ void dialog_changed(buf_T *buf, bool checkall) } // restore to empty when write failed - if (empty_buf) { + if (empty_bufname) { XFREE_CLEAR(buf->b_fname); XFREE_CLEAR(buf->b_ffname); XFREE_CLEAR(buf->b_sfname); |