patch 8.1.1049: when user tries to exit with CTRL-C message is confusing
Problem: When user tries to exit with CTRL-C message is confusing.
Solution: Only mention ":qa!" when there is a changed buffer. (closes #4163)
diff --git a/src/undo.c b/src/undo.c
index b2d1d9f..4fd58a3 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -3531,6 +3531,19 @@
}
/*
+ * Return TRUE if any buffer has changes. Also buffers that are not written.
+ */
+ int
+anyBufIsChanged(void)
+{
+ buf_T *buf;
+
+ FOR_ALL_BUFFERS(buf)
+ if (bufIsChanged(buf))
+ return TRUE;
+}
+
+/*
* Like bufIsChanged() but ignoring a terminal window.
*/
int