mirror of
https://github.com/vim/vim.git
synced 2025-10-08 06:04:08 -04:00
patch 8.2.4704: using "else" after return or break increases indent
Problem: Using "else" after return or break increases indent. Solution: Remove "else" and reduce indent. (Goc Dundar, closes #10099)
This commit is contained in:
committed by
Bram Moolenaar
parent
cb49a1d934
commit
f26c16144d
48
src/option.c
48
src/option.c
@@ -4384,38 +4384,36 @@ set_option_value(
|
||||
#endif
|
||||
if (flags & P_STRING)
|
||||
return set_string_option(opt_idx, string, opt_flags);
|
||||
else
|
||||
|
||||
varp = get_varp_scope(&(options[opt_idx]), opt_flags);
|
||||
if (varp != NULL) // hidden option is not changed
|
||||
{
|
||||
varp = get_varp_scope(&(options[opt_idx]), opt_flags);
|
||||
if (varp != NULL) // hidden option is not changed
|
||||
if (number == 0 && string != NULL)
|
||||
{
|
||||
if (number == 0 && string != NULL)
|
||||
int idx;
|
||||
|
||||
// Either we are given a string or we are setting option
|
||||
// to zero.
|
||||
for (idx = 0; string[idx] == '0'; ++idx)
|
||||
;
|
||||
if (string[idx] != NUL || idx == 0)
|
||||
{
|
||||
int idx;
|
||||
// There's another character after zeros or the string
|
||||
// is empty. In both cases, we are trying to set a
|
||||
// num option using a string.
|
||||
semsg(_(e_number_required_after_str_equal_str),
|
||||
name, string);
|
||||
return NULL; // do nothing as we hit an error
|
||||
|
||||
// Either we are given a string or we are setting option
|
||||
// to zero.
|
||||
for (idx = 0; string[idx] == '0'; ++idx)
|
||||
;
|
||||
if (string[idx] != NUL || idx == 0)
|
||||
{
|
||||
// There's another character after zeros or the string
|
||||
// is empty. In both cases, we are trying to set a
|
||||
// num option using a string.
|
||||
semsg(_(e_number_required_after_str_equal_str),
|
||||
name, string);
|
||||
return NULL; // do nothing as we hit an error
|
||||
|
||||
}
|
||||
}
|
||||
if (flags & P_NUM)
|
||||
return set_num_option(opt_idx, varp, number,
|
||||
NULL, 0, opt_flags);
|
||||
else
|
||||
return set_bool_option(opt_idx, varp, (int)number,
|
||||
opt_flags);
|
||||
}
|
||||
if (flags & P_NUM)
|
||||
return set_num_option(opt_idx, varp, number,
|
||||
NULL, 0, opt_flags);
|
||||
else
|
||||
return set_bool_option(opt_idx, varp, (int)number, opt_flags);
|
||||
}
|
||||
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user