summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgor Zvorykin <egzvor@gmail.com>2021-11-17 14:01:14 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-17 14:01:14 +0000
commit125ffd21f9601a90b845f1d50c24da0d3938bb59 (patch)
tree589c77f58da8397c31ccfdb82a6f80f7a3d61320
parent9459b8d461d6f8345bfa3fb9b3b4297a7950b0bc (diff)
downloadvim-git-125ffd21f9601a90b845f1d50c24da0d3938bb59.tar.gz
patch 8.2.3608: users who type "q:" instead of ":q" are confusedv8.2.3608
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)
-rw-r--r--runtime/defaults.vim11
-rw-r--r--src/testdir/test_autocmd.vim1
-rw-r--r--src/testdir/test_cmdline.vim1
-rw-r--r--src/version.c2
4 files changed, 15 insertions, 0 deletions
diff --git a/runtime/defaults.vim b/runtime/defaults.vim
index f3c639bc7..9b46c8e78 100644
--- a/runtime/defaults.vim
+++ b/runtime/defaults.vim
@@ -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
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 9eb718f9d..045320e5f 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -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('$')
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 87ae6faa2..295e59db2 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -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]
diff --git a/src/version.c b/src/version.c
index e0bc5c1c5..e5146bc03 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3608,
+/**/
3607,
/**/
3606,