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)
diff --git a/src/option.c b/src/option.c
index 49123aa..f636985 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4384,38 +4384,36 @@
#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;
}