From f3fa6507f2473d66a4c6172c82dec43bf55f8df6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 8 Dec 2024 07:00:17 +0800 Subject: 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 https://github.com/vim/vim/commit/d9e9f89e0ffd6e7ce5e2a7f8f1ace5471e37c210 Co-authored-by: Shougo Matsushita --- src/nvim/message.c | 5 +++++ src/nvim/options.lua | 1 + 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/nvim/message.c b/src/nvim/message.c index a32a06edca..f6424c4644 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1103,6 +1103,11 @@ int messagesopt_changed(void) 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/nvim/options.lua b/src/nvim/options.lua index a5d5a45b59..e08f3d1410 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -5467,6 +5467,7 @@ return { 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. -- cgit From 96329910b011414758380e3c27e32c0ae7f43e1e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 8 Dec 2024 07:01:59 +0800 Subject: vim-patch:9.1.0911: Variable name for 'messagesopt' doesn't match short name Problem: Variable name for 'messagesopt' doesn't match short name (after v9.1.0908) Solution: Change p_meo to p_mopt. Add more details to docs. closes: vim/vim#16182 https://github.com/vim/vim/commit/8cc43daee1f485c9abf1de3c638cce7835b9f861 --- src/nvim/message.c | 2 +- src/nvim/option_vars.h | 2 +- src/nvim/options.lua | 20 +++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/nvim/message.c b/src/nvim/message.c index f6424c4644..d8e6fd3001 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1063,7 +1063,7 @@ int messagesopt_changed(void) int messages_wait_new = 0; int messages_history_new = 0; - char *p = p_meo; + char *p = p_mopt; while (*p != NUL) { if (strnequal(p, S_LEN(MESSAGES_OPT_HIT_ENTER))) { p += STRLEN_LITERAL(MESSAGES_OPT_HIT_ENTER); diff --git a/src/nvim/option_vars.h b/src/nvim/option_vars.h index aca876bddb..97455380cc 100644 --- a/src/nvim/option_vars.h +++ b/src/nvim/option_vars.h @@ -448,7 +448,7 @@ EXTERN OptInt p_mfd; ///< 'maxfuncdepth' EXTERN OptInt p_mmd; ///< 'maxmapdepth' EXTERN OptInt p_mmp; ///< 'maxmempattern' EXTERN OptInt p_mis; ///< 'menuitems' -EXTERN char *p_meo; ///< 'messagesopt' +EXTERN char *p_mopt; ///< 'messagesopt' EXTERN char *p_msm; ///< 'mkspellmem' EXTERN int p_ml; ///< 'modeline' EXTERN int p_mle; ///< 'modelineexpr' diff --git a/src/nvim/options.lua b/src/nvim/options.lua index e08f3d1410..afce4a918b 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -5456,22 +5456,24 @@ return { flags = true, deny_duplicates = true, desc = [=[ - Option settings when outputting messages. It can consist of the + Option settings for 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 + hit-enter Use a |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). - The maximum value is 10000. + wait:{n} Instead of using a |hit-enter| prompt, simply wait for + {n} milliseconds so that the user has a chance to read + the message. The maximum value of {n} is 10000. Use + 0 to disable the wait (but then the user may miss an + important message). + This item is ignored when "hit-enter" is present, but + required when "hit-enter" is not present. 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. + This item must always be present. ]=], expand_cb = 'expand_set_messagesopt', full_name = 'messagesopt', @@ -5479,7 +5481,7 @@ return { scope = { 'global' }, short_desc = N_('options for outputting messages'), type = 'string', - varname = 'p_meo', + varname = 'p_mopt', }, { abbreviation = 'msm', -- cgit