VHDLFormatter
VHDLFormatter copied to clipboard
Propose: improving `if` statement with multiline conditions
Report a bug
Input and also Expected Behavior
The end of multi-line conditions ) then
should be outdented in the next line to be at the same indentation level as if (
.
if (
long_condition_1
or long_condition_2
) then
x <= '1';
else
x <= '0';
end if;
Actual Behavior
The end of multi-line conditions ) then
is indented at the same level of conditions and also statements in the if
body.
if (
long_condition_1
or long_condition_2
) then -- should not be indented
x <= '1';
else
x <= '0';
end if;
In general, if some parenthesis or bracket is opened at some line, but closed at other line, The closing line should be at the same indentation level of the opening line. The content between these lines should indented one level.