mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
vim-patch:7.4.602
Problem: ":set" does not accept hex numbers as documented.
Solution: Use vim_str2nr(). (ZyX)
18400e6430
This commit is contained in:
parent
e2cbac7634
commit
615e298a94
@ -58,9 +58,7 @@ achieve special effects. These options come in three forms:
|
||||
:se[t] {option}:{value}
|
||||
Set string or number option to {value}.
|
||||
For numeric options the value can be given in decimal,
|
||||
hex (preceded with 0x) or octal (preceded with '0')
|
||||
(hex and octal are only available for machines which
|
||||
have the strtol() function).
|
||||
hex (preceded with 0x) or octal (preceded with '0').
|
||||
The old value can be inserted by typing 'wildchar' (by
|
||||
default this is a <Tab>). See |cmdline-completion|.
|
||||
White space between {option} and '=' is allowed and
|
||||
|
@ -1214,17 +1214,10 @@ do_set (
|
||||
errmsg = e_invarg;
|
||||
goto skip;
|
||||
}
|
||||
}
|
||||
/* allow negative numbers (for 'undolevels') */
|
||||
else if (*arg == '-' || ascii_isdigit(*arg)) {
|
||||
i = 0;
|
||||
if (*arg == '-')
|
||||
i = 1;
|
||||
value = strtol((char *)arg, NULL, 0);
|
||||
if (arg[i] == '0' && TOLOWER_ASC(arg[i + 1]) == 'x')
|
||||
i += 2;
|
||||
while (ascii_isdigit(arg[i]))
|
||||
++i;
|
||||
} else if (*arg == '-' || ascii_isdigit(*arg)) {
|
||||
// Allow negative (for 'undolevels'), octal and
|
||||
// hex numbers.
|
||||
vim_str2nr(arg, NULL, &i, true, true, &value, NULL);
|
||||
if (arg[i] != NUL && !ascii_iswhite(arg[i])) {
|
||||
errmsg = e_invarg;
|
||||
goto skip;
|
||||
|
@ -319,7 +319,7 @@ static int included_patches[] = {
|
||||
// 605,
|
||||
// 604,
|
||||
// 603,
|
||||
// 602,
|
||||
602,
|
||||
601,
|
||||
600,
|
||||
599,
|
||||
|
Loading…
Reference in New Issue
Block a user