aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-27 05:58:27 +0800
committerGitHub <noreply@github.com>2022-07-27 05:58:27 +0800
commit289256337a5de9993e592ad0adaea7fef14af86c (patch)
tree64880e0e91bb98ddff6a5cc76555d62cf25c3075 /src/nvim/ex_cmds.c
parent7e939ddb874b66414fc09bb1b33c34838b45b184 (diff)
parent4225e6ee46c55ff0930c8435a049309974b7c006 (diff)
downloadrneovim-289256337a5de9993e592ad0adaea7fef14af86c.tar.gz
rneovim-289256337a5de9993e592ad0adaea7fef14af86c.tar.bz2
rneovim-289256337a5de9993e592ad0adaea7fef14af86c.zip
Merge pull request #19523 from ii14/vim-9.0.0085
vim-patch:9.0.0085: ":write" fails after ":file name" and the ":edit"
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 11eef0ac70..ea0fa31183 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2725,6 +2725,12 @@ int do_ecmd(int fnum, char *ffname, char *sfname, exarg_T *eap, linenr_T newlnum
// Assume success now
retval = OK;
+ // If the file name was changed, reset the not-edit flag so that ":write"
+ // works.
+ if (!other_file) {
+ curbuf->b_flags &= ~BF_NOTEDITED;
+ }
+
/*
* Check if we are editing the w_arg_idx file in the argument list.
*/