mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.0.1183: code is indented more than necessary (#21773)
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes vim/vim#11805)
0233bdfa2b
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
parent
2aabe9b858
commit
a5f4ba7447
@ -1396,11 +1396,13 @@ void fixthisline(IndentGetter get_the_indent)
|
||||
{
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user