Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into tabsidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtnn committed Dec 7, 2024
2 parents d546a6a + 6e6aff0 commit e01894a
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 26 deletions.
19 changes: 11 additions & 8 deletions runtime/doc/options.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -5638,21 +5638,24 @@ A jump table for the options with a short description can be found at |Q_op|.
'messagesopt' 'mopt' string (default "hit-enter,history:500")
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.

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).
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.

*'mkspellmem'* *'msm'*
'mkspellmem' 'msm' string (default "460000,2000,500")
Expand Down
2 changes: 1 addition & 1 deletion runtime/doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -11266,7 +11266,7 @@ vietnamese vietnamese.txt /*vietnamese*
vietnamese-ime_diff vietnamese.txt /*vietnamese-ime_diff*
vietnamese-intro vietnamese.txt /*vietnamese-intro*
vietnamese-keymap vietnamese.txt /*vietnamese-keymap*
vietnamese-l18n vietnamese.txt /*vietnamese-l18n*
vietnamese-l10n vietnamese.txt /*vietnamese-l10n*
vietnamese-telex_utf-8 vietnamese.txt /*vietnamese-telex_utf-8*
vietnamese-viqr_utf-8 vietnamese.txt /*vietnamese-viqr_utf-8*
vietnamese-vni_utf-8 vietnamese.txt /*vietnamese-vni_utf-8*
Expand Down
6 changes: 3 additions & 3 deletions runtime/doc/vietnamese.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Vietnamese language support in Vim *vietnamese* *Vietnamese*

1. Introduction |vietnamese-intro|
2. Vietnamese keymaps |vietnamese-keymap|
3. Localization |vietnamese-l18n|
3. Localization |vietnamese-l10n|

===============================================================================
1. Introduction
Expand All @@ -17,7 +17,7 @@ Vim supports Vietnamese language in the following ways:

- Built-in |vietnamese-keymap|, which allows you to type Vietnamese characters
in |Insert-mode| and |search-commands| using US keyboard layout.
- Localization in Vietnamese. See |vietnamese-l18n|
- Localization in Vietnamese. See |vietnamese-l10n|

===============================================================================
2. Vietnamese keymaps
Expand Down Expand Up @@ -63,7 +63,7 @@ below:

===============================================================================
3. Localization
*vietnamese-l18n*
*vietnamese-l10n*
Vim |messages| are also available in Vietnamese. If you wish to see messages
in Vietnamese, you can run the command |:language| with an argument being the
name of the Vietnamese locale. For example, >
Expand Down
4 changes: 2 additions & 2 deletions runtime/optwin.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2024 Jul 12
" Last Change: 2024 Dec 07
" Former Maintainer: Bram Moolenaar <[email protected]>

" If there already is an option window, jump to that one.
Expand Down Expand Up @@ -749,7 +749,7 @@ call <SID>AddOption("terse", gettext("add 's' flag in 'shortmess' (don't show se
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("messagesopt", gettext("Option settings when outputting messages"))
call <SID>AddOption("messagesopt", gettext("options for 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
Expand Down
6 changes: 5 additions & 1 deletion src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ messagesopt_changed(void)
int messages_wait_new = 0;
int messages_history_new = 0;

p = p_meo;
p = p_mopt;
while (*p != NUL)
{
if (STRNCMP(p, MESSAGES_OPT_HIT_ENTER,
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ EXTERN long p_mmt; // 'maxmemtot'
#ifdef FEAT_MENU
EXTERN long p_mis; // 'menuitems'
#endif
EXTERN char_u *p_meo; // 'messagesopt'
EXTERN char_u *p_mopt; // 'messagesopt'
#ifdef FEAT_SPELL
EXTERN char_u *p_msm; // 'mkspellmem'
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/optiondefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,7 @@ static struct vimoption options[] =
(char_u *)NULL, PV_NONE, NULL, NULL,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"messagesopt","mopt", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_COLON|P_NODUP,
(char_u *)&p_meo, PV_NONE, did_set_messagesopt, expand_set_messagesopt,
(char_u *)&p_mopt, PV_NONE, did_set_messagesopt, expand_set_messagesopt,
{(char_u *)"hit-enter,history:500", (char_u *)NULL} SCTX_INIT},
{"mkspellmem", "msm", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE,
#ifdef FEAT_SPELL
Expand Down
6 changes: 3 additions & 3 deletions src/optionstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3055,11 +3055,11 @@ did_set_messagesopt(optset_T *args UNUSED)
int
expand_set_messagesopt(optexpand_T *args, int *numMatches, char_u ***matches)
{
static char *(p_meo_values[]) = {"hit-enter", "wait:", "history:", NULL};
static char *(p_mopt_values[]) = {"hit-enter", "wait:", "history:", NULL};
return expand_set_opt_string(
args,
p_meo_values,
ARRAY_LENGTH(p_meo_values) - 1,
p_mopt_values,
ARRAY_LENGTH(p_mopt_values) - 1,
numMatches,
matches);
}
Expand Down
3 changes: 2 additions & 1 deletion src/testdir/gen_opt_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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']],
Expand Down
4 changes: 2 additions & 2 deletions src/testdir/test_messages.vim
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,12 @@ func Test_messagesopt_wait()

" Check hit-enter prompt
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))})

" Check no hit-enter prompt when "wait:" is set
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))})

" clean up
Expand Down
6 changes: 6 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,12 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
912,
/**/
911,
/**/
910,
/**/
909,
/**/
Expand Down
12 changes: 9 additions & 3 deletions src/xxd/xxd.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
* 10.09.2024 Support -b and -i together, #15661
* 19.10.2024 -e did add an extra space #15899
* 11.11.2024 improve end-of-options argument parser #9285
* 07.12.2024 fix overflow with xxd --autoskip and large sparse files #16175
*
* (c) 1990-1998 by Juergen Weigert ([email protected])
*
Expand Down Expand Up @@ -146,7 +147,7 @@ extern void perror __P((char *));
# endif
#endif

char version[] = "xxd 2024-11-11 by Juergen Weigert et al.";
char version[] = "xxd 2024-12-07 by Juergen Weigert et al.";
#ifdef WIN32
char osver[] = " (Win32)";
#else
Expand Down Expand Up @@ -515,7 +516,7 @@ huntype(
}

/*
* Print line l. If nz is false, xxdline regards the line a line of
* Print line l. If nz is false, xxdline regards the line as a line of
* zeroes. If there are three or more consecutive lines of zeroes,
* they are replaced by a single '*' character.
*
Expand All @@ -530,7 +531,7 @@ huntype(
xxdline(FILE *fp, char *l, int nz)
{
static char z[LLEN+1];
static int zero_seen = 0;
static signed char zero_seen = 0;

if (!nz && zero_seen == 1)
strcpy(z, l);
Expand All @@ -551,6 +552,11 @@ xxdline(FILE *fp, char *l, int nz)
if (nz)
zero_seen = 0;
}

/* If zero_seen > 3, then its exact value doesn't matter, so long as it
* remains >3 and incrementing it will not cause overflow. */
if (zero_seen >= 0x7F)
zero_seen = 4;
}

/* This is an EBCDIC to ASCII conversion table */
Expand Down

0 comments on commit e01894a

Please sign in to comment.