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