mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
Merge pull request #31504 from zeertzjq/vim-9.1.0910
vim-patch:9.1.{0910,0911}: 'messagesopt' followup
This commit is contained in:
commit
4fcc5cd34a
@ -4048,21 +4048,24 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'messagesopt'* *'mopt'*
|
*'messagesopt'* *'mopt'*
|
||||||
'messagesopt' 'mopt' string (default "hit-enter,history:500")
|
'messagesopt' 'mopt' string (default "hit-enter,history:500")
|
||||||
global
|
global
|
||||||
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.
|
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.
|
'cmdheight' size.
|
||||||
|
|
||||||
wait:{n} Ignored when "hit-enter" is present. Instead of using
|
wait:{n} Instead of using a |hit-enter| prompt, simply wait for
|
||||||
|hit-enter| prompt, will simply wait for {n}
|
{n} milliseconds so that the user has a chance to read
|
||||||
milliseconds so the user has a chance to read the
|
the message. The maximum value of {n} is 10000. Use
|
||||||
message, use 0 to disable sleep (but then the user may
|
0 to disable the wait (but then the user may miss an
|
||||||
miss an important message).
|
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
|
history:{n} Determines how many entries are remembered in the
|
||||||
|:messages| history. The maximum value is 10000.
|
|:messages| history. The maximum value is 10000.
|
||||||
Setting it to zero clears the message history.
|
Setting it to zero clears the message history.
|
||||||
|
This item must always be present.
|
||||||
|
|
||||||
*'mkspellmem'* *'msm'*
|
*'mkspellmem'* *'msm'*
|
||||||
'mkspellmem' 'msm' string (default "460000,2000,500")
|
'mkspellmem' 'msm' string (default "460000,2000,500")
|
||||||
|
17
runtime/lua/vim/_meta/options.lua
generated
17
runtime/lua/vim/_meta/options.lua
generated
@ -4084,21 +4084,24 @@ vim.o.mis = vim.o.menuitems
|
|||||||
vim.go.menuitems = vim.o.menuitems
|
vim.go.menuitems = vim.o.menuitems
|
||||||
vim.go.mis = vim.go.menuitems
|
vim.go.mis = vim.go.menuitems
|
||||||
|
|
||||||
--- 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.
|
--- 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.
|
--- 'cmdheight' size.
|
||||||
---
|
---
|
||||||
--- wait:{n} Ignored when "hit-enter" is present. Instead of using
|
--- wait:{n} Instead of using a `hit-enter` prompt, simply wait for
|
||||||
--- `hit-enter` prompt, will simply wait for {n}
|
--- {n} milliseconds so that the user has a chance to read
|
||||||
--- milliseconds so the user has a chance to read the
|
--- the message. The maximum value of {n} is 10000. Use
|
||||||
--- message, use 0 to disable sleep (but then the user may
|
--- 0 to disable the wait (but then the user may miss an
|
||||||
--- miss an important message).
|
--- 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
|
--- history:{n} Determines how many entries are remembered in the
|
||||||
--- `:messages` history. The maximum value is 10000.
|
--- `:messages` history. The maximum value is 10000.
|
||||||
--- Setting it to zero clears the message history.
|
--- Setting it to zero clears the message history.
|
||||||
|
--- This item must always be present.
|
||||||
---
|
---
|
||||||
--- @type string
|
--- @type string
|
||||||
vim.o.messagesopt = "hit-enter,history:500"
|
vim.o.messagesopt = "hit-enter,history:500"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" These commands create the option window.
|
" These commands create the option window.
|
||||||
"
|
"
|
||||||
" Maintainer: The Vim Project <https://github.com/vim/vim>
|
" Maintainer: The Vim Project <https://github.com/vim/vim>
|
||||||
" Last Change: 2024 Jul 12
|
" Last Change: 2024 Dec 07
|
||||||
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
|
|
||||||
" If there already is an option window, jump to that one.
|
" If there already is an option window, jump to that one.
|
||||||
@ -626,7 +626,7 @@ call <SID>AddOption("terse", gettext("add 's' flag in 'shortmess' (don't show se
|
|||||||
call <SID>BinOptionG("terse", &terse)
|
call <SID>BinOptionG("terse", &terse)
|
||||||
call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter"))
|
call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter"))
|
||||||
call <SID>OptionG("shm", &shm)
|
call <SID>OptionG("shm", &shm)
|
||||||
call <SID>AddOption("messagesopt", gettext("Option settings when outputting messages"))
|
call <SID>AddOption("messagesopt", gettext("options for outputting messages"))
|
||||||
call <SID>OptionG("mopt", &mopt)
|
call <SID>OptionG("mopt", &mopt)
|
||||||
call <SID>AddOption("showcmd", gettext("show (partial) command keys in location given by 'showcmdloc'"))
|
call <SID>AddOption("showcmd", gettext("show (partial) command keys in location given by 'showcmdloc'"))
|
||||||
let &sc = s:old_sc
|
let &sc = s:old_sc
|
||||||
|
@ -1063,7 +1063,7 @@ int messagesopt_changed(void)
|
|||||||
int messages_wait_new = 0;
|
int messages_wait_new = 0;
|
||||||
int messages_history_new = 0;
|
int messages_history_new = 0;
|
||||||
|
|
||||||
char *p = p_meo;
|
char *p = p_mopt;
|
||||||
while (*p != NUL) {
|
while (*p != NUL) {
|
||||||
if (strnequal(p, S_LEN(MESSAGES_OPT_HIT_ENTER))) {
|
if (strnequal(p, S_LEN(MESSAGES_OPT_HIT_ENTER))) {
|
||||||
p += STRLEN_LITERAL(MESSAGES_OPT_HIT_ENTER);
|
p += STRLEN_LITERAL(MESSAGES_OPT_HIT_ENTER);
|
||||||
@ -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;
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ EXTERN OptInt p_mfd; ///< 'maxfuncdepth'
|
|||||||
EXTERN OptInt p_mmd; ///< 'maxmapdepth'
|
EXTERN OptInt p_mmd; ///< 'maxmapdepth'
|
||||||
EXTERN OptInt p_mmp; ///< 'maxmempattern'
|
EXTERN OptInt p_mmp; ///< 'maxmempattern'
|
||||||
EXTERN OptInt p_mis; ///< 'menuitems'
|
EXTERN OptInt p_mis; ///< 'menuitems'
|
||||||
EXTERN char *p_meo; ///< 'messagesopt'
|
EXTERN char *p_mopt; ///< 'messagesopt'
|
||||||
EXTERN char *p_msm; ///< 'mkspellmem'
|
EXTERN char *p_msm; ///< 'mkspellmem'
|
||||||
EXTERN int p_ml; ///< 'modeline'
|
EXTERN int p_ml; ///< 'modeline'
|
||||||
EXTERN int p_mle; ///< 'modelineexpr'
|
EXTERN int p_mle; ///< 'modelineexpr'
|
||||||
|
@ -5456,21 +5456,24 @@ return {
|
|||||||
flags = true,
|
flags = true,
|
||||||
deny_duplicates = true,
|
deny_duplicates = true,
|
||||||
desc = [=[
|
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.
|
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.
|
'cmdheight' size.
|
||||||
|
|
||||||
wait:{n} Ignored when "hit-enter" is present. Instead of using
|
wait:{n} Instead of using a |hit-enter| prompt, simply wait for
|
||||||
|hit-enter| prompt, will simply wait for {n}
|
{n} milliseconds so that the user has a chance to read
|
||||||
milliseconds so the user has a chance to read the
|
the message. The maximum value of {n} is 10000. Use
|
||||||
message, use 0 to disable sleep (but then the user may
|
0 to disable the wait (but then the user may miss an
|
||||||
miss an important message).
|
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
|
history:{n} Determines how many entries are remembered in the
|
||||||
|:messages| history. The maximum value is 10000.
|
|:messages| history. The maximum value is 10000.
|
||||||
Setting it to zero clears the message history.
|
Setting it to zero clears the message history.
|
||||||
|
This item must always be present.
|
||||||
]=],
|
]=],
|
||||||
expand_cb = 'expand_set_messagesopt',
|
expand_cb = 'expand_set_messagesopt',
|
||||||
full_name = 'messagesopt',
|
full_name = 'messagesopt',
|
||||||
@ -5478,7 +5481,7 @@ return {
|
|||||||
scope = { 'global' },
|
scope = { 'global' },
|
||||||
short_desc = N_('options for outputting messages'),
|
short_desc = N_('options for outputting messages'),
|
||||||
type = 'string',
|
type = 'string',
|
||||||
varname = 'p_meo',
|
varname = 'p_mopt',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
abbreviation = 'msm',
|
abbreviation = 'msm',
|
||||||
|
@ -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']],
|
||||||
|
@ -646,12 +646,12 @@ func Test_messagesopt_wait()
|
|||||||
|
|
||||||
" Check hit-enter prompt
|
" Check hit-enter prompt
|
||||||
call term_sendkeys(buf, ":set messagesopt=hit-enter,history:500\n")
|
call term_sendkeys(buf, ":set messagesopt=hit-enter,history:500\n")
|
||||||
call term_sendkeys(buf, ":echo 'foo' | echo 'bar' echo 'baz'\n")
|
call term_sendkeys(buf, ":echo 'foo' | echo 'bar' | echo 'baz'\n")
|
||||||
call WaitForAssert({-> assert_equal('Press ENTER or type command to continue', term_getline(buf, 6))})
|
call WaitForAssert({-> assert_equal('Press ENTER or type command to continue', term_getline(buf, 6))})
|
||||||
|
|
||||||
" Check no hit-enter prompt when "wait:" is set
|
" Check no hit-enter prompt when "wait:" is set
|
||||||
call term_sendkeys(buf, ":set messagesopt=wait:100,history:500\n")
|
call term_sendkeys(buf, ":set messagesopt=wait:100,history:500\n")
|
||||||
call term_sendkeys(buf, ":echo 'foo' | echo 'bar' echo 'baz'\n")
|
call term_sendkeys(buf, ":echo 'foo' | echo 'bar' | echo 'baz'\n")
|
||||||
call WaitForAssert({-> assert_equal(' 0,0-1 All', term_getline(buf, 6))})
|
call WaitForAssert({-> assert_equal(' 0,0-1 All', term_getline(buf, 6))})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
|
Loading…
Reference in New Issue
Block a user