-
Notifications
You must be signed in to change notification settings - Fork 926
Formatter does not fold a long line #5412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reaching out. I'm unable to reproduce this. I'm using fn main() {
if is_action {
if let Some(action) = all_actions.borrow_mut().iter_mut().find(|action| action.shortcut == shortcut) {
stack.push((action.callback)().into());
} else {
ui.invoke_show_message(
format!("Command with shortcut \"{shortcut}\" (found at line {line_number}) not found!").into(),
);
}
}
} After running rustfmt I get: fn main() {
if is_action {
if let Some(action) = all_actions
.borrow_mut()
.iter_mut()
.find(|action| action.shortcut == shortcut)
{
stack.push((action.callback)().into());
} else {
ui.invoke_show_message(
format!(
"Command with shortcut \"{shortcut}\" (found at line {line_number}) not found!"
)
.into(),
);
}
}
} When you get a chance can you confirm that the issue was the snippet or perhaps provide a different snippet that illustrates the problem that you're having. |
Oh, it really works fine without the context. Here's the full snippet: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9a0eaa300539229fd54f8d84da914295 @ytmimi (if tagging is inappropriate, sorry: I don't know whether it is a good practice, I rarely file or view issues) |
Thanks for including the full snippet. The extra context really helps! I see now that we're dealing with a deeply nested structure. Almost certain this is a duplicate of #3416, and #3863 so going to close accordingly. If you're using a nightly rustfmt, you can try setting You can run rustfmt manually on your file with the following:
If you're using a stable rustfmt you can try bumping up the
Passing config values via the command line is tedious so you might consider adding a Also, tagging me is just fine 👍🏼 |
^ two lines here are longer than 100 characters (even not considering the additional indentation in my code), but none of those are folded
rustfmt version: rustfmt 1.4.38-stable (fe5b13d6 2022-05-18)
The text was updated successfully, but these errors were encountered: