mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #16954 from f380cedric/vim-8.2.3402
vim-patch:8.2.{3402,3403}
This commit is contained in:
commit
14751eaf70
@ -2008,9 +2008,9 @@ static void didset_options2(void)
|
|||||||
// Parse default for 'wildmode'.
|
// Parse default for 'wildmode'.
|
||||||
check_opt_wim();
|
check_opt_wim();
|
||||||
xfree(curbuf->b_p_vsts_array);
|
xfree(curbuf->b_p_vsts_array);
|
||||||
tabstop_set(curbuf->b_p_vsts, &curbuf->b_p_vsts_array);
|
(void)tabstop_set(curbuf->b_p_vsts, &curbuf->b_p_vsts_array);
|
||||||
xfree(curbuf->b_p_vts_array);
|
xfree(curbuf->b_p_vts_array);
|
||||||
tabstop_set(curbuf->b_p_vts, &curbuf->b_p_vts_array);
|
(void)tabstop_set(curbuf->b_p_vts, &curbuf->b_p_vts_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check for string options that are NULL (normally only termcap options).
|
/// Check for string options that are NULL (normally only termcap options).
|
||||||
@ -6412,7 +6412,7 @@ void buf_copy_options(buf_T *buf, int flags)
|
|||||||
buf->b_p_sts_nopaste = p_sts_nopaste;
|
buf->b_p_sts_nopaste = p_sts_nopaste;
|
||||||
buf->b_p_vsts = vim_strsave(p_vsts);
|
buf->b_p_vsts = vim_strsave(p_vsts);
|
||||||
if (p_vsts && p_vsts != empty_option) {
|
if (p_vsts && p_vsts != empty_option) {
|
||||||
tabstop_set(p_vsts, &buf->b_p_vsts_array);
|
(void)tabstop_set(p_vsts, &buf->b_p_vsts_array);
|
||||||
} else {
|
} else {
|
||||||
buf->b_p_vsts_array = 0;
|
buf->b_p_vsts_array = 0;
|
||||||
}
|
}
|
||||||
@ -6492,7 +6492,7 @@ void buf_copy_options(buf_T *buf, int flags)
|
|||||||
if (dont_do_help) {
|
if (dont_do_help) {
|
||||||
buf->b_p_isk = save_p_isk;
|
buf->b_p_isk = save_p_isk;
|
||||||
if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) {
|
if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) {
|
||||||
tabstop_set(p_vts, &buf->b_p_vts_array);
|
(void)tabstop_set(p_vts, &buf->b_p_vts_array);
|
||||||
} else {
|
} else {
|
||||||
buf->b_p_vts_array = NULL;
|
buf->b_p_vts_array = NULL;
|
||||||
}
|
}
|
||||||
@ -6502,7 +6502,7 @@ void buf_copy_options(buf_T *buf, int flags)
|
|||||||
buf->b_p_ts = p_ts;
|
buf->b_p_ts = p_ts;
|
||||||
buf->b_p_vts = vim_strsave(p_vts);
|
buf->b_p_vts = vim_strsave(p_vts);
|
||||||
if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) {
|
if (p_vts && p_vts != empty_option && !buf->b_p_vts_array) {
|
||||||
tabstop_set(p_vts, &buf->b_p_vts_array);
|
(void)tabstop_set(p_vts, &buf->b_p_vts_array);
|
||||||
} else {
|
} else {
|
||||||
buf->b_p_vts_array = NULL;
|
buf->b_p_vts_array = NULL;
|
||||||
}
|
}
|
||||||
@ -7195,7 +7195,7 @@ static void paste_option_changed(void)
|
|||||||
xfree(buf->b_p_vsts_array);
|
xfree(buf->b_p_vsts_array);
|
||||||
}
|
}
|
||||||
if (buf->b_p_vsts && buf->b_p_vsts != empty_option) {
|
if (buf->b_p_vsts && buf->b_p_vsts != empty_option) {
|
||||||
tabstop_set(buf->b_p_vsts, &buf->b_p_vsts_array);
|
(void)tabstop_set(buf->b_p_vsts, &buf->b_p_vsts_array);
|
||||||
} else {
|
} else {
|
||||||
buf->b_p_vsts_array = 0;
|
buf->b_p_vsts_array = 0;
|
||||||
}
|
}
|
||||||
@ -7513,6 +7513,7 @@ int check_ff_value(char_u *p)
|
|||||||
|
|
||||||
// Set the integer values corresponding to the string setting of 'vartabstop'.
|
// Set the integer values corresponding to the string setting of 'vartabstop'.
|
||||||
// "array" will be set, caller must free it if needed.
|
// "array" will be set, caller must free it if needed.
|
||||||
|
// Return false for an error.
|
||||||
bool tabstop_set(char_u *var, long **array)
|
bool tabstop_set(char_u *var, long **array)
|
||||||
{
|
{
|
||||||
long valcount = 1;
|
long valcount = 1;
|
||||||
@ -7532,7 +7533,7 @@ bool tabstop_set(char_u *var, long **array)
|
|||||||
if (cp != end) {
|
if (cp != end) {
|
||||||
emsg(_(e_positive));
|
emsg(_(e_positive));
|
||||||
} else {
|
} else {
|
||||||
emsg(_(e_invarg));
|
semsg(_(e_invarg2), cp);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -7545,7 +7546,7 @@ bool tabstop_set(char_u *var, long **array)
|
|||||||
valcount++;
|
valcount++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
emsg(_(e_invarg));
|
semsg(_(e_invarg2), var);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7554,7 +7555,15 @@ bool tabstop_set(char_u *var, long **array)
|
|||||||
|
|
||||||
t = 1;
|
t = 1;
|
||||||
for (cp = var; *cp != NUL;) {
|
for (cp = var; *cp != NUL;) {
|
||||||
(*array)[t++] = atoi((char *)cp);
|
int n = atoi((char *)cp);
|
||||||
|
|
||||||
|
// Catch negative values, overflow and ridiculous big values.
|
||||||
|
if (n < 0 || n > 9999) {
|
||||||
|
semsg(_(e_invarg2), cp);
|
||||||
|
XFREE_CLEAR(*array);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
(*array)[t++] = n;
|
||||||
while (*cp != NUL && *cp != ',') {
|
while (*cp != NUL && *cp != ',') {
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
|
@ -74,4 +74,7 @@ endfunc
|
|||||||
func Test_retab_error()
|
func Test_retab_error()
|
||||||
call assert_fails('retab -1', 'E487:')
|
call assert_fails('retab -1', 'E487:')
|
||||||
call assert_fails('retab! -1', 'E487:')
|
call assert_fails('retab! -1', 'E487:')
|
||||||
|
call assert_fails('ret -1000', 'E487:')
|
||||||
|
call assert_fails('ret 10000', 'E475:')
|
||||||
|
call assert_fails('ret 80000000000000000000', 'E475:')
|
||||||
endfunc
|
endfunc
|
||||||
|
Loading…
Reference in New Issue
Block a user