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)
diff --git a/src/indent.c b/src/indent.c
index cbb3f94..477a44d 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2188,12 +2188,12 @@
{
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
}
/*