mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-23 10:53:35 +01:00
Retype: retype.find's params text says a null more runs a new search
retype.find reads `more` with opt_bool, which treats null as omitted, so
`{more: null}` runs a new search. The params text said any value other
than true or false is an error. The params text, its MCP mirror and
docs/mcp.md now say that false, omitted or null runs a new search and
that a value other than true, false or null is an error. A test checks
that a null more lists the first ten again.
This commit is contained in:
1 parent
2bc41aeb86
commit
16de36545c
4 files changed
+7
-4
No files matched your search
@@ -837,7 +837,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"retype.find",
|
||||
"Find Matching Fonts",
|
||||
"",
|
||||
"{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns",
|
||||
"{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does (more false, omitted or null: a new search), or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more other than true, false or null, is an error and leaves the list as it was; returns what retype.list returns",
|
||||
),
|
||||
(
|
||||
"retype.list",
|
||||
|
||||
@@ -838,7 +838,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"retype.find",
|
||||
"Find Matching Fonts",
|
||||
"",
|
||||
"{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does, or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more that is not true or false, is an error and leaves the list as it was; returns what retype.list returns",
|
||||
"{more?: bool} show the Retype panel and list the fonts whose glyphs match the selected outlined text, compared and ranked as type.retypeFonts does (up to 96 loaded fonts, those of the document's live type first): ten, as Find Matching Fonts does (more false, omitted or null: a new search), or with more: true the next five fonts the last search found (whatever is selected now; before any search, a first search), as Find more font matches does; the document does not change; a search with no path or compound path selected, or a more other than true, false or null, is an error and leaves the list as it was; returns what retype.list returns",
|
||||
),
|
||||
(
|
||||
"retype.list",
|
||||
|
||||
@@ -97,6 +97,8 @@ fn more_adds_fonts_until_none_is_left() {
|
||||
}
|
||||
assert_eq!(last["more"], json!(false), "{last}");
|
||||
assert_eq!(app.run("retype.find", json!({"more": true})).unwrap(), last, "nothing is left to add");
|
||||
// A null more is omitted: a new search lists the first ten again.
|
||||
assert_eq!(app.run("retype.find", json!({"more": null})).unwrap(), first);
|
||||
// Before any search, more is a first search.
|
||||
app.run("retype.reset", json!({})).unwrap();
|
||||
assert_eq!(app.run("retype.find", json!({"more": true})).unwrap(), first);
|
||||
|
||||
+3
-2
@@ -12171,8 +12171,9 @@ path selected it is an error.
|
||||
Window › Retype shows the Retype panel. Find Matching Fonts runs `retype.find {}`, which shows the panel, ranks up to
|
||||
96 fonts and lists the first ten. Find more font matches, at the end of the list when `more` is true, runs
|
||||
`retype.find {more: true}`, which adds the next five fonts that search found, whatever is selected now. Before any
|
||||
search, `retype.find {more: true}` runs a first search. A search that fails is an error and leaves the list as it
|
||||
was. Each row shows the font's family and style over a sample of the font. While live type is selected or edited, a
|
||||
search, `retype.find {more: true}` runs a first search. With `more` false, omitted or null, `retype.find` runs a new
|
||||
search; any other value than true, false or null is an error. A search that fails is an error and leaves the list as
|
||||
it was. Each row shows the font's family and style over a sample of the font. While live type is selected or edited, a
|
||||
click on a row sets that font on it, as the font menus do; live type inside a selected group counts too. The list
|
||||
stays when the selection changes.
|
||||
|
||||
|
||||
Reference in new issue
Block a user