diff src/ex_cmds.c @ 19693:9fbeb3bdf49e v8.2.0403

patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check Commit: https://github.com/vim/vim/commit/a3a9c8ef697bbf6f640cde99710b6f534f29f77d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 19 12:38:34 2020 +0100 patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check Problem: When 'buftype' is "nofile" there is no overwrite check. Solution: Also check for existing file when 'buftype' is set. (closes #5807)
author Bram Moolenaar <Bram@vim.org>
date Thu, 19 Mar 2020 12:45:04 +0100
parents 7096af834c42
children 5feb426d2ea1
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2074,8 +2074,8 @@ check_overwrite(
     int		other)	    // writing under other name
 {
     /*
-     * 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)
@@ -2083,9 +2083,6 @@ check_overwrite(
 		    && vim_strchr(p_cpo, CPO_OVERNEW) == NULL)
 		|| (buf->b_flags & BF_READERR))
 	    && !p_wa
-#ifdef FEAT_QUICKFIX
-	    && !bt_nofilename(buf)
-#endif
 	    && vim_fexists(ffname))
     {
 	if (!eap->forceit && !eap->append)