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/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 1224a3f..4c63bb8 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -1,5 +1,7 @@
" Test for various Normal mode commands
+source shared.vim
+
func Setup_NewWindow()
10new
call setline(1, range(1,100))
@@ -2542,3 +2544,13 @@
%bwipeout!
endfunc
+
+func Test_message_when_using_ctrl_c()
+ exe "normal \<C-C>"
+ call assert_match("Type :qa and press <Enter> to exit Vim", Screenline(&lines))
+ new
+ cal setline(1, 'hi!')
+ exe "normal \<C-C>"
+ call assert_match("Type :qa! and press <Enter> to abandon all changes and exit Vim", Screenline(&lines))
+ bwipe!
+endfunc