patch 9.0.1183: 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 #11805)
This commit is contained in:
Yegappan Lakshmanan
2023-01-12 12:33:30 +00:00
committed by Bram Moolenaar
parent 043d7b2c84
commit 0233bdfa2b
9 changed files with 401 additions and 381 deletions

View File

@ -2188,12 +2188,12 @@ fixthisline(int (*get_the_indent)(void))
{
int amount = get_the_indent();
if (amount >= 0)
{
change_indent(INDENT_SET, amount, FALSE, 0, TRUE);
if (linewhite(curwin->w_cursor.lnum))
did_ai = TRUE; // delete the indent if the line stays empty
}
if (amount < 0)
return;
change_indent(INDENT_SET, amount, FALSE, 0, TRUE);
if (linewhite(curwin->w_cursor.lnum))
did_ai = TRUE; // delete the indent if the line stays empty
}
/*