mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-31 05:47:00 -06:00
File › Options › Proofing › AutoCorrect Options did nothing on the Start screen: tools.autocorrect wasn't in works_without_document, so the click was dropped. Its options are user preferences (session.prefs), like the other File › Options settings, so it now works without a document. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Brandon Thomas <echelon@gmail.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
Brandon Thomas
parent
bd85c72f39
commit
4fcc409c8b
+3
-1
File diff suppressed because one or more lines are too long
@@ -992,7 +992,8 @@ fn input_dialog_other(id: &str, params: &Value) -> Option<&'static str> {
|
||||
|
||||
/// Commands that work while no document is open (#1129): opening or creating one, closing the
|
||||
/// window, Help, adding fonts (a font file dropped on the empty window), and the settings (File ›
|
||||
/// Options, the view and interface preferences it sets, Customize Ribbon and Keyboard).
|
||||
/// Options, the view and interface preferences it sets, AutoCorrect Options, Customize Ribbon and
|
||||
/// Keyboard).
|
||||
/// Everything else needs a document, `ui.*` included: only the interface commands listed here
|
||||
/// (tabs, Backstage, dialogs, appearance, opening files) work without one.
|
||||
pub(crate) fn works_without_document(id: &str) -> bool {
|
||||
@@ -1010,6 +1011,7 @@ pub(crate) fn works_without_document(id: &str) -> bool {
|
||||
| "font.remove"
|
||||
| "readAloud.speed"
|
||||
| "readAloud.skipCitations"
|
||||
| "tools.autocorrect"
|
||||
| "tools.customizeKeyboard"
|
||||
| "tools.customizeRibbon"
|
||||
| "view.darkMode"
|
||||
|
||||
@@ -661,6 +661,10 @@ fn start_screen_shows_file_home_and_esc_leaves_no_document() {
|
||||
let refused = a.run("ui.zotero.status", json!({})).unwrap_err();
|
||||
assert!(refused.contains("No document is open"), "refused before it runs: {refused}");
|
||||
assert!(works_without_document("font.add"), "a font file dropped on the empty window is added");
|
||||
// #4585: File › Options › Proofing › AutoCorrect Options edits a user setting, not the document.
|
||||
a.run("tools.autocorrect", json!({})).unwrap();
|
||||
assert_eq!(a.dialog.as_ref().map(|d| d.name()), Some("autoCorrect"));
|
||||
a.dialog = None;
|
||||
// Neither keys nor commands reach the hidden placeholder.
|
||||
assert!(a.run("text.insert", json!({"text": "Hello"})).is_err());
|
||||
assert!(a.execute("format.bold", json!({})).is_err());
|
||||
|
||||
+3
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user