HaxeCheckstyle / haxe-formatter

Haxe code formatter based on tokentree
https://haxecheckstyle.github.io/haxe-formatter-docs/#codesamples.CommonSamples.allman_curlies
MIT License
72 stars 16 forks source link

Trailing whitespace gets moved to previous line #646

Closed romamik closed 2 years ago

romamik commented 2 years ago

Describe the bug
Trailing whitespace gets moved to previous line. Is not working with v 1.12, but is working perfectly in version used on https://haxecheckstyle.github.io/haxe-formatter-docs/.

Input file

class Main {
static function main() {
trace(1);

trace(2);
}
}

Broken output

class Main {
→static function main() {
→→trace(1);→→

→→trace(2);
→}
}

Expected output

class Main {
→static function main() {
→→trace(1);
→→
→→trace(2);
→}
}

Optional: hxformat.json

{
    "indentation": {
        "trailingWhitespace": true
    }
}
romamik commented 2 years ago

Sorry to ask, but is something wrong with this issue?

AlexHaxe commented 2 years ago

apologies, I was busy back when and then simply forgot about it. so thanks for the reminder! changes have been merged, I'll rename the test case and add a changelog entry for it.

thanks for your contribution (and patience)!