diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-15 19:26:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 19:26:32 +0800 |
commit | b9f15caf5ca879841afe582f68838af208b86142 (patch) | |
tree | 783afc0e6f1cc54610b20fe27aeb26625158b5af /src/nvim/ex_cmds.c | |
parent | 564d99c89a3d9a236df758d320cc38abc50215ec (diff) | |
parent | 0cf5cd1ac9c8ec31c1d2f1b1a6585153a45fc4e9 (diff) | |
download | rneovim-b9f15caf5ca879841afe582f68838af208b86142.tar.gz rneovim-b9f15caf5ca879841afe582f68838af208b86142.tar.bz2 rneovim-b9f15caf5ca879841afe582f68838af208b86142.zip |
Merge pull request #19375 from zeertzjq/vim-8.2.0403
vim-patch:8.1.1547,8.2.0403: when 'buftype' is "nofile" there is no overwrite check
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 9a5cf9f50f..28e1893b31 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -1980,17 +1980,14 @@ theend: /// @return OK if it's OK, FAIL if it is not. int check_overwrite(exarg_T *eap, buf_T *buf, char *fname, char *ffname, int other) { - /* - * write to other file or b_flags set or not writing the whole file: - * overwriting only allowed with '!' - */ + // Write to another file or b_flags set or not writing the whole file: + // overwriting only allowed with '!' if ((other || (buf->b_flags & BF_NOTEDITED) || ((buf->b_flags & BF_NEW) && vim_strchr(p_cpo, CPO_OVERNEW) == NULL) || (buf->b_flags & BF_READERR)) && !p_wa - && !bt_nofile(buf) && os_path_exists((char_u *)ffname)) { if (!eap->forceit && !eap->append) { #ifdef UNIX |