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:
committed by
Bram Moolenaar
parent
043d7b2c84
commit
0233bdfa2b
12
src/indent.c
12
src/indent.c
@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user