]> granicus.if.org Git - vim/commitdiff
patch 8.2.3608: users who type "q:" instead of ":q" are confused v8.2.3608
authorEgor Zvorykin <egzvor@gmail.com>
Wed, 17 Nov 2021 14:01:14 +0000 (14:01 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 17 Nov 2021 14:01:14 +0000 (14:01 +0000)
Problem:    Users who type "q:" instead of ":q" are confused.
Solution:   Add an autocmd to give a message that explains this is the
            command-line window. (Egor Zvorykin, closes #9146)

runtime/defaults.vim
src/testdir/test_autocmd.vim
src/testdir/test_cmdline.vim
src/version.c

index f3c639bc74d2309e5b076a264a448fa73753e20c..9b46c8e78a53c1b3cdb548c9b6c0e881900c6486 100644 (file)
@@ -111,6 +111,17 @@ if 1
 
   augroup END
 
+  " Quite a few people accidentally type "q:" instead of ":q" and get confused
+  " by the command line window.  Give a hint about how to get out.
+  " If you don't like this you can put this in your vimrc:
+  " ":augroup vimHints | au! | augroup END"
+  augroup vimHints
+    autocmd! CmdwinEnter *
+         \ echohl Todo | 
+         \ echo 'You discovered the command-line window! You can close it with ":q".' |
+         \ echohl None
+  augroup END
+
 endif
 
 " Switch syntax highlighting on when the terminal has colors or when using the
index 9eb718f9da4c6de08a925432b3702b9690a4f597..045320e5f59ee3b64dc0d6835ba7827aff1a2b10 100644 (file)
@@ -2458,6 +2458,7 @@ func Test_autocmd_CmdWinEnter()
   CheckFeature cmdwin
 
   let lines =<< trim END
+    augroup vimHints | au! | augroup END
     let b:dummy_var = 'This is a dummy'
     autocmd CmdWinEnter * quit
     let winnr = winnr('$')
index 87ae6faa2f45efa2b7ed6e04f45d260db2606d48..295e59db2f0e4d01e3882306fd3b580df7f28331 100644 (file)
@@ -1255,6 +1255,7 @@ func Test_cmdwin_restore()
   CheckScreendump
 
   let lines =<< trim [SCRIPT]
+    augroup vimHints | au! | augroup END
     call setline(1, range(30))
     2split
   [SCRIPT]
index e0bc5c1c5d778e75b2a36bafc1e991d9e10a85ed..e5146bc03a9223224c871f0df335692b5c612804 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3608,
 /**/
     3607,
 /**/