Commit: patch 9.1.0910: 'messagesopt' does not check max wait time

8 views
Skip to first unread message

Christian Brabandt

unread,
Dec 7, 2024, 10:15:12 AM12/7/24
to vim...@googlegroups.com
patch 9.1.0910: 'messagesopt' does not check max wait time

Commit: https://github.com/vim/vim/commit/d9e9f89e0ffd6e7ce5e2a7f8f1ace5471e37c210
Author: Shougo Matsushita <Shougo...@gmail.com>
Date: Sat Dec 7 16:00:25 2024 +0100

patch 9.1.0910: 'messagesopt' does not check max wait time

Problem: 'messagesopt' does not check max wait time
(after v9.1.0908)
Solution: Check for max wait value
(Shougo Matsushita)

closes: #16183

Signed-off-by: Shougo Matsushita <Shougo...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index a31d04154..e2ce17612 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 06
+*options.txt* For Vim version 9.1. Last change: 2024 Dec 07


VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5649,6 +5649,7 @@ A jump table for the options with a short description can be found at |Q_op|.
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).
+ The maximum value is 10000.

history:{n} Determines how many entries are remembered in the
|:messages| history. The maximum value is 10000.
diff --git a/src/message.c b/src/message.c
index 34a269218..6b994e5e4 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1137,6 +1137,10 @@ messagesopt_changed(void)
if (messages_history_new > 10000)
return FAIL;

+ // "wait" must be <= 10000
+ if (messages_wait_new > 10000)
+ return FAIL;
+
msg_flags = messages_flags_new;
msg_wait = messages_wait_new;

diff --git a/src/testdir/gen_opt_test.vim b/src/testdir/gen_opt_test.vim
index 8bfa57d64..74f5ae52c 100644
--- a/src/testdir/gen_opt_test.vim
+++ b/src/testdir/gen_opt_test.vim
@@ -236,7 +236,8 @@ let test_values = {
\ 'history:100,wait:100', 'history:0,wait:0',
\ 'hit-enter,history:1,wait:1'],
\ ['xxx', 'history:500', 'hit-enter,history:-1',
- \ 'hit-enter,history:10001', 'hit-enter']],
+ \ 'hit-enter,history:10001', 'history:0,wait:10001',
+ \ 'hit-enter']],
\ 'mkspellmem': [['10000,100,12'], ['', 'xxx', '10000,100']],
\ 'mouse': [['', 'n', 'v', 'i', 'c', 'h', 'a', 'r', 'nvi'],
\ ['xxx', 'n,v,i']],
diff --git a/src/version.c b/src/version.c
index e5d1eb130..9c29c4e97 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 910,
/**/
909,
/**/
Reply all
Reply to author
Forward
0 new messages