summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-08-30 13:07:17 +0200
committerBram Moolenaar <Bram@vim.org>2018-08-30 13:07:17 +0200
commit8c9e7b00f6566dc41e794ef11c93d93b034c7134 (patch)
tree56a99a9d90f4800e1cf20f136affc8a15b2e786f /src/ex_cmds2.c
parent92c1b696413bf0e28f2fec22090d42e8a825eff2 (diff)
patch 8.1.0334: 'autowrite' takes effect when buffer is not to be writtenv8.1.0334
Problem: 'autowrite' takes effect when buffer is not to be written. Solution: Don't write buffers that are not supposed to be written. (Even Q Jones, closes #3391) Add tests for 'autowrite'.
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index cb046357db..89effa1417 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -2041,7 +2041,7 @@ autowrite(buf_T *buf, int forceit)
}
/*
- * flush all buffers, except the ones that are readonly
+ * Flush all buffers, except the ones that are readonly or are never written.
*/
void
autowrite_all(void)
@@ -2051,7 +2051,7 @@ autowrite_all(void)
if (!(p_aw || p_awa) || !p_write)
return;
FOR_ALL_BUFFERS(buf)
- if (bufIsChanged(buf) && !buf->b_p_ro)
+ if (bufIsChanged(buf) && !buf->b_p_ro && !bt_dontwrite(buf))
{
bufref_T bufref;