vim-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: vim/vim#16183

d9e9f89e0f

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
This commit is contained in:
zeertzjq 2024-12-08 07:00:17 +08:00
parent 668d2569b4
commit f3fa6507f2
5 changed files with 10 additions and 1 deletions

View File

@ -4059,6 +4059,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 milliseconds so the user has a chance to read the
message, use 0 to disable sleep (but then the user may message, use 0 to disable sleep (but then the user may
miss an important message). miss an important message).
The maximum value is 10000.
history:{n} Determines how many entries are remembered in the history:{n} Determines how many entries are remembered in the
|:messages| history. The maximum value is 10000. |:messages| history. The maximum value is 10000.

View File

@ -4095,6 +4095,7 @@ vim.go.mis = vim.go.menuitems
--- milliseconds so the user has a chance to read the --- milliseconds so the user has a chance to read the
--- message, use 0 to disable sleep (but then the user may --- message, use 0 to disable sleep (but then the user may
--- miss an important message). --- miss an important message).
--- The maximum value is 10000.
--- ---
--- history:{n} Determines how many entries are remembered in the --- history:{n} Determines how many entries are remembered in the
--- `:messages` history. The maximum value is 10000. --- `:messages` history. The maximum value is 10000.

View File

@ -1103,6 +1103,11 @@ int messagesopt_changed(void)
return FAIL; return FAIL;
} }
// "wait" must be <= 10000
if (messages_wait_new > 10000) {
return FAIL;
}
msg_flags = messages_flags_new; msg_flags = messages_flags_new;
msg_wait = messages_wait_new; msg_wait = messages_wait_new;

View File

@ -5467,6 +5467,7 @@ return {
milliseconds so the user has a chance to read the milliseconds so the user has a chance to read the
message, use 0 to disable sleep (but then the user may message, use 0 to disable sleep (but then the user may
miss an important message). miss an important message).
The maximum value is 10000.
history:{n} Determines how many entries are remembered in the history:{n} Determines how many entries are remembered in the
|:messages| history. The maximum value is 10000. |:messages| history. The maximum value is 10000.

View File

@ -267,7 +267,8 @@ let test_values = {
\ 'history:100,wait:100', 'history:0,wait:0', \ 'history:100,wait:100', 'history:0,wait:0',
\ 'hit-enter,history:1,wait:1'], \ 'hit-enter,history:1,wait:1'],
\ ['xxx', 'history:500', 'hit-enter,history:-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']], \ 'mkspellmem': [['10000,100,12'], ['', 'xxx', '10000,100']],
\ 'mouse': [['', 'n', 'v', 'i', 'c', 'h', 'a', 'r', 'nvi'], \ 'mouse': [['', 'n', 'v', 'i', 'c', 'h', 'a', 'r', 'nvi'],
\ ['xxx', 'n,v,i']], \ ['xxx', 'n,v,i']],