diff options
author | ii14 <ii14@users.noreply.github.com> | 2022-07-26 20:54:43 +0200 |
---|---|---|
committer | ii14 <ii14@users.noreply.github.com> | 2022-07-26 20:57:57 +0200 |
commit | 4225e6ee46c55ff0930c8435a049309974b7c006 (patch) | |
tree | be4214d4750a138c96495ae0f03283525270e668 /src/nvim/ex_cmds.c | |
parent | 2a9c9371bc6d7e3c92eace673d1ed3740b12a270 (diff) | |
download | rneovim-4225e6ee46c55ff0930c8435a049309974b7c006.tar.gz rneovim-4225e6ee46c55ff0930c8435a049309974b7c006.tar.bz2 rneovim-4225e6ee46c55ff0930c8435a049309974b7c006.zip |
vim-patch:9.0.0085: ":write" fails after ":file name" and the ":edit"
Problem: ":write" fails after ":file name" and the ":edit".
Solution: Reset BF_NOTEDITED when using ":edit". (closes vim/vim#10790)
https://github.com/vim/vim/commit/1f0dc5e84f5cc530c0fb9d0789e3d42d644429d7
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 6 |
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. */ |