patch 9.1.0908: not possible to configure :messages
Problem: not possible to configure :messages
Solution: add the 'messagesopt' option (Shougo Matsushita)
closes: #16068
Co-authored-by: h_east <h.east.727@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index 69d8bc7..3fcbd95 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -1,4 +1,4 @@
-*message.txt* For Vim version 9.1. Last change: 2024 Nov 14
+*message.txt* For Vim version 9.1. Last change: 2024 Dec 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -29,7 +29,7 @@
Clear messages, keeping only the {count} most
recent ones.
-The number of remembered messages is determined by the 'msghistory' option.
+The number of remembered messages is determined by the 'messagesopt' option.
*g<*
The "g<" command can be used to see the last page of previous command output.
@@ -837,6 +837,7 @@
text then use |g<|. This only works when 'more' is set.
To reduce the number of hit-enter prompts:
+- Set 'messagesopt'.
- Set 'cmdheight' to 2 or higher.
- Add flags to 'shortmess'.
- Reset 'showcmd' and/or 'ruler'.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 273ea64..a31d041 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 9.1. Last change: 2024 Dec 03
+*options.txt* For Vim version 9.1. Last change: 2024 Dec 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4439,7 +4439,7 @@
global
A history of ":" commands, and a history of previous search patterns
is remembered. This option decides how many entries may be stored in
- each of these histories (see |cmdline-editing| and 'msghistory' for
+ each of these histories (see |cmdline-editing| and 'messagesopt' for
the number of messages to remember).
The maximum value is 10000.
NOTE: This option is set to the Vi default value when 'compatible' is
@@ -5634,6 +5634,26 @@
generated from a list of items, e.g., the Buffers menu. Changing this
option has no direct effect, the menu must be refreshed first.
+ *'messagesopt'* *'mopt'*
+'messagesopt' 'mopt' string (default "hit-enter,history:500")
+ global
+
+ Option settings when outputting messages. It can consist of the
+ following items. Items must be separated by a comma.
+
+ hit-enter Use |hit-enter| prompt when the message is longer than
+ 'cmdheight' size.
+
+ wait:{n} Ignored when "hit-enter" is present. Instead of using
+ |hit-enter| prompt, will simply wait for {n}
+ milliseconds so the user has a chance to read the
+ message, use 0 to disable sleep (but then the user may
+ miss an important message).
+
+ history:{n} Determines how many entries are remembered in the
+ |:messages| history. The maximum value is 10000.
+ Setting it to zero clears the message history.
+
*'mkspellmem'* *'msm'*
'mkspellmem' 'msm' string (default "460000,2000,500")
global
@@ -5917,13 +5937,6 @@
time in msec between two mouse clicks for the second click to be
recognized as a multi click.
- *'msghistory'* *'mhi'*
-'msghistory' 'mhi' number (default 500)
- global
- Determines how many entries are remembered in the |:messages| history.
- The maximum value is 10000.
- Setting it to zero clears the message history.
-
*'mzquantum'* *'mzq'*
'mzquantum' 'mzq' number (default 100)
diff --git a/runtime/doc/tags b/runtime/doc/tags
index ad87006..f0ca51b 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -499,9 +499,9 @@
'menc' options.txt /*'menc'*
'menuitems' options.txt /*'menuitems'*
'mesg' vi_diff.txt /*'mesg'*
+'messagesopt' options.txt /*'messagesopt'*
'mfd' options.txt /*'mfd'*
'mh' options.txt /*'mh'*
-'mhi' options.txt /*'mhi'*
'mis' options.txt /*'mis'*
'mkspellmem' options.txt /*'mkspellmem'*
'ml' options.txt /*'ml'*
@@ -517,6 +517,7 @@
'modelines' options.txt /*'modelines'*
'modifiable' options.txt /*'modifiable'*
'modified' options.txt /*'modified'*
+'mopt' options.txt /*'mopt'*
'more' options.txt /*'more'*
'mouse' options.txt /*'mouse'*
'mousef' options.txt /*'mousef'*
@@ -532,7 +533,6 @@
'mousetime' options.txt /*'mousetime'*
'mp' options.txt /*'mp'*
'mps' options.txt /*'mps'*
-'msghistory' options.txt /*'msghistory'*
'msm' options.txt /*'msm'*
'mzq' options.txt /*'mzq'*
'mzquantum' options.txt /*'mzquantum'*
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index f5f77b3..312a1c2 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt* For Vim version 9.1. Last change: 2024 Dec 05
+*version9.txt* For Vim version 9.1. Last change: 2024 Dec 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41667,7 +41667,7 @@
popup
'findfunc' Vim function to obtain the results for a |:find|
command
-'msghistory' Max number of messages to remember
+'messagesopt' configure |:messages| and |hit-enter| prompt
'winfixbuf' Keep buffer focused in a window
'tabclose' Which tab page to focus after closing a tab page
't_xo' Terminal uses XON/XOFF handshaking (e.g. vt420)
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index c8170da..c3f917c 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -749,8 +749,8 @@
call <SID>BinOptionG("terse", &terse)
call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter"))
call <SID>OptionG("shm", &shm)
-call <SID>AddOption("msghistory", gettext("how many messages are remembered"))
-call append("$", " \tset mhi=" . &mhi)
+call <SID>AddOption("messagesopt", gettext("Option settings when outputting messages"))
+call <SID>OptionG("mopt", &mopt)
call <SID>AddOption("showcmd", gettext("show (partial) command keys in location given by 'showcmdloc'"))
let &sc = s:old_sc
call <SID>BinOptionG("sc", &sc)