Closed dev-zero closed 3 years ago
the problem are the label numbers: removing them makes fprettify behave consistently again, and the number of spaces added for indentation depend on the number of spaces between the label number and FORMAT
.
ok, that's what I got so far:
After the first pass of reformat_ffile_combined
we get for the labeled lines:
200 FORMAT('RUNNING THE L-BFGS-B CODE', /, /, &
in the second pass the difference of spaces inserted between the label and the format also get added to the line continuations, while the present spaces are not stripped since we are in the auto_align = False
branch.
From what I see there are multiple solutions:
FORMAT
is correct after the first pass alreadyauto_format
and a non-auto_format
due to line continuationsmanual_lines_indent
for this caseFORMAT
statement completely and always indent to 6 spaces no matter the surrounding since it must anyway always be labeledThanks for investigating this. The problem occurs if the label numbers are wider than the logical indentation width (which causes an offset in the continuation lines). Should be fixed soon.
Hm there are still cases in CP2K triggering this or a similar bug, having a look again...
in the following example from CP2K an extra space is inserted before each continued line every time
fprettify
runs on the file: