Formatter removes lines (1 per formatting) after scope block in function body #22900
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: vfmt
Bugs/feature requests, that are related to the `vfmt`, the formatter for V.
Describe the bug
When using a block to encapsulate some logic in a function, v fmt removes the lines after it in an inconsistent way.
Reproduction Steps
Format below:
v fmt
fn main() { { println('(1/3) My first small scope') // } - { println('(2/3) My second small scope') // } // A line below prevents the line removal { println('(3/3) My Third small scope') } }
vfmt
fn main() { { println('(1/3) My first small scope') // } - { println('(2/3) My second small scope') // } // A line below prevents the line removal { println('(3/3) My Third small scope') } }
Expected Behavior
Keep one line after a block when it is followed by multiple empty lines and it's not the end of the function body.
Current Behavior
above
Possible Solution
No response
Additional Information/Context
No response
V version
v0.4.8
Environment details (OS name and version, etc.)
linux
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Huly®: V_0.6-21343
The text was updated successfully, but these errors were encountered: