From 9e4adaf3202e5ba0ffb095f07dbfcbcc00a443cb Mon Sep 17 00:00:00 2001 From: totoz64 <47389794+totoz64@users.noreply.github.com> Date: Mon, 26 Oct 2026 10:21:10 +0100 Subject: [PATCH] M7: apply the hosted rustfmt corrections to the proofing pane Apply the six formatting hunks reported by the exact-head Printing/CI runs. No behavior change. cargo xtask ci was attempted locally but cargo is absent; hosted checks must validate this revision. --- crates/engine/src/cmd/review.rs | 9 ++++++--- crates/ui-egui/src/lib.rs | 4 +++- crates/ui-egui/src/proofing_pane.rs | 18 ++++++++++++------ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/crates/engine/src/cmd/review.rs b/crates/engine/src/cmd/review.rs index 4c168b2a06..873c7f674f 100644 --- a/crates/engine/src/cmd/review.rs +++ b/crates/engine/src/cmd/review.rs @@ -999,9 +999,12 @@ fn next_issue(s: &mut Session, v: &Value) -> CmdResult { // Scan forward first, including the rest of the caret's paragraph. A second pass // optionally visits the earlier part; never select the first typo repeatedly in // a single-paragraph story. Dialogs disable wrapping so Ignore Once can finish. - for (path, before) in paths.iter().skip(start).map(|path| (path, false)).chain( - paths.iter().take(if wrap { start.saturating_add(1) } else { 0 }).map(|path| (path, true)), - ) { + for (path, before) in paths + .iter() + .skip(start) + .map(|path| (path, false)) + .chain(paths.iter().take(if wrap { start.saturating_add(1) } else { 0 }).map(|path| (path, true))) + { for (a, b, i) in para_issues(s, story, path) { if *path == caret.path && (a.off < caret.off) != before { continue; diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 9c2fe38c13..9b0eb7577f 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1121,7 +1121,9 @@ impl WordApp { } // User proofing opens the persistent task pane; scripts keep structured results. // Right-click and Shift+F10 retain their compact suggestions menu. - if matches!(id, "review.spelling" | "review.editor") && let Ok(v) = &r { + if matches!(id, "review.spelling" | "review.editor") + && let Ok(v) = &r + { self.spelling_review = Some(proofing_pane::SpellingForm::new(self, v.clone())); } let r = system_clipboard::explain(self, id, r); diff --git a/crates/ui-egui/src/proofing_pane.rs b/crates/ui-egui/src/proofing_pane.rs index bfbcb9a0ca..6710530be9 100644 --- a/crates/ui-egui/src/proofing_pane.rs +++ b/crates/ui-egui/src/proofing_pane.rs @@ -52,8 +52,8 @@ impl SpellingForm { #[cfg(test)] pub(crate) fn content_text(&self) -> Vec { - let mut text: Vec = self.issue.get("suggestions").and_then(Value::as_array).into_iter().flatten() - .filter_map(Value::as_str).map(str::to_string).collect(); + let mut text: Vec = + self.issue.get("suggestions").and_then(Value::as_array).into_iter().flatten().filter_map(Value::as_str).map(str::to_string).collect(); text.push(format!("{}{}{}", self.context_before, self.issue.get("text").and_then(Value::as_str).unwrap_or(""), self.context_after)); text } @@ -149,8 +149,8 @@ fn body(app: &mut WordApp, ui: &mut Ui, form: &mut SpellingForm) { context(ui, app, form, spelling); ui.add_space(12.0); ui.label(egui::RichText::new(tl!("Suggestions")).font(regular(11.0)).color(t.text_dim)); - let suggestions: Vec = form.issue.get("suggestions").and_then(Value::as_array).into_iter().flatten() - .filter_map(Value::as_str).map(str::to_string).collect(); + let suggestions: Vec = + form.issue.get("suggestions").and_then(Value::as_array).into_iter().flatten().filter_map(Value::as_str).map(str::to_string).collect(); let mut change = None; if suggestions.is_empty() { ui.label(egui::RichText::new(tl!("(no suggestions)")).italics()); @@ -170,7 +170,11 @@ fn body(app: &mut WordApp, ui: &mut Ui, form: &mut SpellingForm) { ui.painter().rect_filled(rect, 0.0, t.hover); } ui.painter().with_clip_rect(rect.shrink2(vec2(10.0, 0.0))).text( - rect.left_center() + vec2(12.0, 0.0), Align2::LEFT_CENTER, suggestion, semibold(12.5), t.text, + rect.left_center() + vec2(12.0, 0.0), + Align2::LEFT_CENTER, + suggestion, + semibold(12.5), + t.text, ); if response.clicked() { change = Some(suggestion.clone()); @@ -197,7 +201,9 @@ fn body(app: &mut WordApp, ui: &mut Ui, form: &mut SpellingForm) { let _ = app.run("tools.autocorrect", json!({})); ui.close(); } - }).response.on_hover_text(tl!("More options")); + }) + .response + .on_hover_text(tl!("More options")); }); }); }