0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.1166: code is indented more than necessary

Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11792)
This commit is contained in:
Yegappan Lakshmanan
2023-01-09 19:04:23 +00:00
committed by Bram Moolenaar
parent 765d82a657
commit 1cfb14aa97
22 changed files with 929 additions and 903 deletions

View File

@@ -1850,21 +1850,22 @@ find_cmd_after_substitute_cmd(char_u *arg)
find_cmd_after_isearch_cmd(expand_T *xp, char_u *arg)
{
arg = skipwhite(skipdigits(arg)); // skip count
if (*arg == '/') // Match regexp, not just whole words
{
for (++arg; *arg && *arg != '/'; arg++)
if (*arg == '\\' && arg[1] != NUL)
arg++;
if (*arg)
{
arg = skipwhite(arg + 1);
if (*arg != '/')
return NULL;
// Check for trailing illegal characters
if (*arg == NUL || vim_strchr((char_u *)"|\"\n", *arg) == NULL)
xp->xp_context = EXPAND_NOTHING;
else
return arg;
}
// Match regexp, not just whole words
for (++arg; *arg && *arg != '/'; arg++)
if (*arg == '\\' && arg[1] != NUL)
arg++;
if (*arg)
{
arg = skipwhite(arg + 1);
// Check for trailing illegal characters
if (*arg == NUL || vim_strchr((char_u *)"|\"\n", *arg) == NULL)
xp->xp_context = EXPAND_NOTHING;
else
return arg;
}
return NULL;
@@ -2780,7 +2781,7 @@ get_breakadd_arg(expand_T *xp UNUSED, int idx)
{
char *opts[] = {"expr", "file", "func", "here"};
if (idx >=0 && idx <= 3)
if (idx >= 0 && idx <= 3)
{
// breakadd {expr, file, func, here}
if (breakpt_expand_what == EXP_BREAKPT_ADD)