Open
Description
version: rustfmt 1.7.1-nightly (ba1d7f4a 2024-06-29)
config: rustfmt.toml
Formatting is flickering for looooong chain like this:
from this
let removed = roots.extract_if(|root| { /* long block */ }).count();
to this and back:
let removed =
roots.extract_if(|root| { /* long block */ }).count();
Flickering in this case means following:
- run
rustfmt cargo/src/build/mod.rs
=> we've got new line-break- run
rustfmt cargo/src/build/mod.rs
=> line-break is gone- repeat...
example as pr-annotation: boozook/playdate#399 (comment)
Activity
ytmimi commentedon Jul 12, 2024
@boozook Thanks for the report. Please try to reduce this to a minimal reproducible example.
boozook commentedon Jul 12, 2024
@ytmimi, I honestly tried to get an isolated minimal reproducible example, but I can't, sorry. I suppose there is something complex 🤷🏻♂️
Also, just as little addition I've made neat video-demo in the IDE
Untitled.mov
ytmimi commentedon Jul 12, 2024
Thanks for the video. You might try to copy the entire
let removed
assignment into a snippet that's just as indented as the current code and take it from there. If you're able to post that it might help someone start looking into what's going on.boozook commentedon Jul 13, 2024
@ytmimi, done!
example.zip
Seems to it depends on length of ling lines inside the block.
Important things in the config:
Also there is one more problem - cases of
match
has various indent:5 tabs indent
+7*3 spaces align
+2 spaces in-block align
4 tabs indent
+8*3 spaces align
+2 spaces in-block align
boozook commentedon Jan 30, 2025
I suppose there is tag
bug
is missed. 🤷🏻♂️eirnym commentedon Jan 30, 2025
video not playable
boozook commentedon Feb 5, 2025
This problem gives so much pain and requires additional complications to workaround. 😤