sloganking / scfmt

A code formatter for structured comments
MIT License
0 stars 0 forks source link

Don't go too deep #4

Closed sloganking closed 2 years ago

sloganking commented 2 years ago

While running strfmt directly after cargo fmt is fine. Running strfmt repeatedly on it's own will cause code inside a structured comment to have too much whitespace depth.

sloganking commented 2 years ago

Instead of adding whitespace to everything past a //>, we can ensure that everything past it is AT LEAST the same depth + tab_spaces

sloganking commented 2 years ago

Ideation

if, any line inside //> //< is equal to or less than the bracket's whitespace, pop the whole block out. Otherwise, leave it alone.