From 39dc6c365beeb99c26466d87987f937ec66916a3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 21:11:10 -0800 Subject: [PATCH] Type: Convert to Text and Remove Breaks on a selected story include its locked and hidden frames After Select All in a frame of threaded text, Convert to Text skipped the story's locked and hidden frames, even when `ids` named them, and left a paragraph whose text started in one as a list. Remove Line Breaks and Remove Paragraph Breaks also kept the breaks in those frames. A selected story is one text, as it already is for Apply Bullets and Apply Numbers and the Character and Paragraph panels, so both commands now change every frame of the story, as one undo step. - text.convertListToText converts every list paragraph of the story, locked and hidden frames included; `ids` naming a locked or hidden frame converts its paragraphs too. A call that changes nothing adds no undo step. - addon.cleanup.removeBreaks removes the breaks in every frame of the selected story. Docs: docs/mcp.md, docs/target-app-parity.md. --- crates/engine/src/cmd/addons/cleanup/text.rs | 10 +- crates/engine/src/cmd/panelcmds.rs | 23 +-- crates/engine/src/tests/textedit.rs | 144 +++++++++++++------ docs/mcp.md | 8 +- docs/target-app-parity.md | 2 +- 5 files changed, 119 insertions(+), 68 deletions(-) diff --git a/crates/engine/src/cmd/addons/cleanup/text.rs b/crates/engine/src/cmd/addons/cleanup/text.rs index 052ba901ed..f9fdba86ae 100644 --- a/crates/engine/src/cmd/addons/cleanup/text.rs +++ b/crates/engine/src/cmd/addons/cleanup/text.rs @@ -72,7 +72,7 @@ pub fn specs() -> Vec { "Remove Breaks", ["Object", "Plug-ins", "Artwork Cleanup"], None, - "{kind: \"line\"|\"paragraph\", ids?: [id…]} remove the forced line breaks (line) or paragraph returns (paragraph) in the characters selected with a Type tool (after Select All in a frame of threaded text, in the text of every frame of the story), else in all the text of the selected type, as one undo step; a break between two words becomes a space, the frames of a threaded story selected all together being read as one text → {ids, removed}", + "{kind: \"line\"|\"paragraph\", ids?: [id…]} remove the forced line breaks (line) or paragraph returns (paragraph) in the characters selected with a Type tool (after Select All in a frame of threaded text, in the text of every frame of the story, locked and hidden frames included), else in all the text of the selected type, as one undo step; a break between two words becomes a space, the frames of a threaded story selected all together being read as one text → {ids, removed}", has_selection, remove_breaks ), @@ -796,8 +796,8 @@ fn apply_cuts(t: &mut TextObject, cuts: &[(usize, bool)], brk: char) -> usize { } /// The breaks `brk` in the text of the frames of `story`, read as one text: a break at the end or -/// start of a frame between words of the frames on either side becomes a space. Each editable frame -/// comes with its own breaks, at its own bytes. +/// start of a frame between words of the frames on either side becomes a space. Each frame comes +/// with its own breaks, at its own bytes, its locked and hidden frames included. fn story_cuts(d: &Document, story: &[NodeId], brk: char) -> Vec<(NodeId, Vec<(usize, bool)>)> { let texts: Vec<(NodeId, String)> = story.iter().filter_map(|id| Some((*id, text_of(d, *id)?.plain_text()))).collect(); let joined: String = texts.iter().map(|(_, t)| t.as_str()).collect(); @@ -811,9 +811,7 @@ fn story_cuts(d: &Document, story: &[NodeId], brk: char) -> Vec<(NodeId, Vec<(us while let Some((at, space)) = cuts.next_if(|(at, _)| *at < end) { own.push((at - start, space)); } - if d.is_editable(id) { - out.push((id, own)); - } + out.push((id, own)); start = end; } out diff --git a/crates/engine/src/cmd/panelcmds.rs b/crates/engine/src/cmd/panelcmds.rs index f9c4b10049..5e96bdd34b 100644 --- a/crates/engine/src/cmd/panelcmds.rs +++ b/crates/engine/src/cmd/panelcmds.rs @@ -76,7 +76,7 @@ pub fn specs() -> Vec { "Convert to Text", [], None, - "{ids?|id?, start?: byte, end?: byte} (Type › Bullets and Numbering › Convert to Text: the paragraphs of the selected type, or of `ids`, or those a start/end range touches; after Select All in a frame of threaded text, without `ids`, `id` or a range, every paragraph of the story's frames that are neither locked nor hidden; while the story is selected, its locked and hidden frames are not converted even when named, nor a paragraph whose text starts in one) the marker of each list paragraph becomes characters of its text: the bullet, or the number and its period as the paragraph showed it, then a tab, at the start of the paragraph in the marker's font, size and color; the list is turned off. When the marker's tab went to the left indent, the paragraph gets a left-aligned tab stop without a leader there, in place of any stop there, which keeps the text after the tab where it started; when it went to a tab stop and a stop there or past it has a leader or is not left-aligned, or a right, center or decimal stop lies between the marker and that place, the paragraph gets a left-aligned stop without a leader where the marker's tab ended, in place of any stop there and of those right, center and decimal stops before it (past the left indent only in a paragraph with no tab of its own). In threaded type the numbers are those counted through the story's frames, and a paragraph that continues into a later frame is converted where its text starts. An empty list paragraph has no marker and only leaves the list. A paragraph with no direction set gets the direction it ran in when the characters would change it (a letter or roman numeral before right-to-left text). With the Every-line Composer, a paragraph with a tab is broken line by line, so a converted paragraph can break its lines at other places. While the Type tool edits, its typing ends first and its anchor and caret move past the characters inserted at or before them (a whole story that Select All selected stays selected when the call converts all of it); in threaded type, when the caret's character moved to another frame, the tool edits that frame, which becomes the selection when it was not selected. One undo step → {ids, converted: paragraphs, inserted: [{id, at: byte before the change, length: bytes}]}", + "{ids?|id?, start?: byte, end?: byte} (Type › Bullets and Numbering › Convert to Text: the paragraphs of the selected type, or of `ids`, or those a start/end range touches; after Select All in a frame of threaded text, without `ids`, `id` or a range, every paragraph of every frame of the story, locked and hidden frames included) the marker of each list paragraph becomes characters of its text: the bullet, or the number and its period as the paragraph showed it, then a tab, at the start of the paragraph in the marker's font, size and color; the list is turned off. When the marker's tab went to the left indent, the paragraph gets a left-aligned tab stop without a leader there, in place of any stop there, which keeps the text after the tab where it started; when it went to a tab stop and a stop there or past it has a leader or is not left-aligned, or a right, center or decimal stop lies between the marker and that place, the paragraph gets a left-aligned stop without a leader where the marker's tab ended, in place of any stop there and of those right, center and decimal stops before it (past the left indent only in a paragraph with no tab of its own). In threaded type the numbers are those counted through the story's frames, and a paragraph that continues into a later frame is converted where its text starts. An empty list paragraph has no marker and only leaves the list. A paragraph with no direction set gets the direction it ran in when the characters would change it (a letter or roman numeral before right-to-left text). With the Every-line Composer, a paragraph with a tab is broken line by line, so a converted paragraph can break its lines at other places. While the Type tool edits, its typing ends first and its anchor and caret move past the characters inserted at or before them (a whole story that Select All selected stays selected when the call converts all of it); in threaded type, when the caret's character moved to another frame, the tool edits that frame, which becomes the selection when it was not selected. One undo step → {ids, converted: paragraphs, inserted: [{id, at: byte before the change, length: bytes}]}", has_doc, convert_list_to_text ), @@ -1305,19 +1305,11 @@ fn convert_list_to_text(s: &mut Session, p: &Value) -> Result { use vectorcraft_doc::text::ParaList; let range = super::typecmd::TextRange::parse(p, C)?; // After Select All in a frame of threaded text, a call that names no type and no range takes - // every paragraph of the story's editable frames; its locked and hidden frames stay as they are - // whichever way they are named. - let full = super::textedit::editing_story(s); - let story: Vec = full.iter().copied().filter(|f| s.doc().is_ok_and(|st| st.doc.is_editable(*f))).collect(); + // every paragraph of every frame of the story, its locked and hidden frames included: the story + // is one text. + let story = super::textedit::editing_story(s); let named = ["ids", "id"].iter().any(|k| p.get(*k).is_some_and(|v| !v.is_null())); - let ids = if !story.is_empty() && !named && range.is_none() { - story.clone() - } else { - super::typecmd::text_targets(s, p, C)?.into_iter().filter(|id| !full.contains(id) || story.contains(id)).collect() - }; - // The selected story's locked and hidden frames: no paragraph whose text starts in one is - // converted, and none of their paragraphs is restyled. - let held: Vec = full.iter().copied().filter(|f| !story.contains(f)).collect(); + let ids = if !story.is_empty() && !named && range.is_none() { story.clone() } else { super::typecmd::text_targets(s, p, C)? }; // Converting the whole story leaves it selected. let whole_story = !story.is_empty() && range.is_none() && story.iter().all(|f| ids.contains(f)); let editing = match super::textedit::editing_range(s)? { @@ -1351,7 +1343,6 @@ fn convert_list_to_text(s: &mut Session, p: &Value) -> Result { let mut converted = 0; for story in &stories { let frames: Vec<&vectorcraft_doc::TextObject> = story.iter().filter_map(|id| text(*id)).collect(); - let is_held = |f: usize| story.get(f).is_some_and(|id| held.contains(id)); let mut paras: Vec = vec![]; let mut named_parts = vec![]; let plains: Vec = frames.iter().map(|t| t.plain_text()).collect(); @@ -1377,7 +1368,7 @@ fn convert_list_to_text(s: &mut Session, p: &Value) -> Result { } for (i, named) in named_parts { if let Some(para) = paras.get_mut(i) { - let listed = para.main_part().is_some_and(|p| p.list.is_some() && !is_held(p.frame)); + let listed = para.main_part().is_some_and(|p| p.list.is_some()); para.converts |= named && listed; } } @@ -1467,7 +1458,7 @@ fn convert_list_to_text(s: &mut Session, p: &Value) -> Result { let tab = vectorcraft_doc::TabStop { position: x, align: vectorcraft_doc::TabAlign::Left, leader: String::new(), align_on: '.' }; style.tabs.insert(i, tab); } - for part in story_para.parts.iter().filter(|q| (std::ptr::eq(*q, para) || q.bytes.is_empty()) && !is_held(q.frame)) { + for part in story_para.parts.iter().filter(|q| std::ptr::eq(*q, para) || q.bytes.is_empty()) { if let Some((stops, _)) = frame_edits.get_mut(part.frame) { stops.push((part.index, style.clone())); } diff --git a/crates/engine/src/tests/textedit.rs b/crates/engine/src/tests/textedit.rs index adcc35d352..9dc35ff99b 100644 --- a/crates/engine/src/tests/textedit.rs +++ b/crates/engine/src/tests/textedit.rs @@ -2265,6 +2265,36 @@ fn remove_breaks_takes_the_whole_story_that_select_all_selected() { assert!(obj(&s, a).plain_text().contains('\n') && obj(&s, b).plain_text().contains('\n')); } +#[test] +fn remove_breaks_of_the_whole_story_takes_locked_and_hidden_frames() { + for command in ["object.lock", "object.hide"] { + for held_first in [false, true] { + let (mut s, a, b, story) = threaded_list_edited_in_its_second_frame(); + let (held, other) = if held_first { (a, b) } else { (b, a) }; + let unrelated = s.execute("text.create", &json!({"x": 10, "y": 500, "text": "One\nTwo", "size": 12})).unwrap()["id"].as_u64().unwrap(); + let unrelated = NodeId(unrelated); + s.execute(command, &json!({"ids": [held.0]})).unwrap(); + s.execute("select.set", &json!({"ids": [other.0]})).unwrap(); + s.select_tool("type", ViewInfo::default()).unwrap(); + s.set_tool_option("textSelection", &json!({"editing": other.0, "anchor": 0, "caret": 0})); + assert_eq!(s.execute("select.all", &json!({})).unwrap()["story"], json!([a.0, b.0])); + let case = format!("{command}, held first: {held_first}"); + let steps = undo_labels(&s).len(); + let r = s.execute("addon.cleanup.removeBreaks", &json!({"kind": "paragraph"})).unwrap(); + assert_eq!(undo_labels(&s).len(), steps + 1, "{case}: one undo step"); + assert!(r["ids"].as_array().unwrap().contains(&json!(held.0)), "{case}: the held frame is changed"); + let joined = format!("{}{}", obj(&s, a).plain_text(), obj(&s, b).plain_text()); + assert_eq!(joined, story.trim_end_matches('\n').replace('\n', " "), "{case}: every frame's returns go"); + assert_eq!(obj(&s, unrelated).plain_text(), "One\nTwo", "{case}: other type is as it was"); + // No return is left: another call fails and adds no undo step. + assert!(s.execute("addon.cleanup.removeBreaks", &json!({"kind": "paragraph"})).is_err()); + assert_eq!(undo_labels(&s).len(), steps + 1, "{case}: no undo step when nothing changes"); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(format!("{}{}", obj(&s, a).plain_text(), obj(&s, b).plain_text()), story, "{case}: undo restores the text"); + } + } +} + #[test] fn remove_breaks_on_a_selected_threaded_story_puts_a_space_between_its_frames() { let (mut s, a, b, story) = threaded_list_edited_in_its_second_frame(); @@ -2306,41 +2336,72 @@ fn convert_to_text_takes_the_whole_story_that_select_all_selected() { } } +/// Whether no paragraph of type `id` is a list. +fn no_list(s: &Session, id: NodeId) -> bool { + let t = obj(s, id); + (0..t.paragraph_count()).all(|k| t.para_at(k).list.is_none()) +} + +/// The bullets held as characters in the frames `ids`. +fn bullet_chars(s: &Session, ids: &[NodeId]) -> usize { + ids.iter().map(|id| obj(s, *id).plain_text().matches("\u{2022}\t").count()).sum() +} + #[test] -fn convert_to_text_of_the_whole_story_leaves_a_locked_frame() { - // Over MCP without ids, and as the Paragraph panel sends it, with every frame of the story. - for named in [false, true] { - let (mut s, a, b, _) = threaded_list_edited_in_its_second_frame(); - s.execute("object.lock", &json!({"ids": [b.0]})).unwrap(); - s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); - s.set_tool_option("textSelection", &json!({"editing": a.0, "anchor": 0, "caret": 0})); - assert_eq!(s.execute("select.all", &json!({})).unwrap()["story"], json!([a.0, b.0])); - // The first frame ends with a paragraph return, so the paragraph that starts the locked - // frame takes in the first frame's empty last part and starts its text there. - let in_a = obj(&s, a).plain_text(); - assert!(in_a.ends_with('\n')); - let own = in_a.split('\n').filter(|piece| !piece.is_empty()).count(); - let p = if named { json!({"ids": [a.0, b.0]}) } else { json!({}) }; - let r = s.execute("text.convertListToText", &p).unwrap(); - assert_eq!(r["ids"], json!([a.0]), "only the editable frame is changed (ids named: {named})"); - assert_eq!(r["converted"], json!(own), "only the paragraphs whose text starts in the editable frame convert"); - assert!(r["inserted"].as_array().unwrap().iter().all(|i| i["id"] == json!(a.0))); - let (ta, tb) = (obj(&s, a), obj(&s, b)); - assert!(ta.plain_text().contains("\u{2022}\t"), "the editable frame is converted"); - let markers = ta.plain_text().matches("\u{2022}\t").count() + tb.plain_text().matches("\u{2022}\t").count(); - assert_eq!(markers, own, "the locked frame's first paragraph keeps its list"); - // The converted text is longer, so the story flows on into the locked frame; its own - // paragraphs stay a list. - let last = tb.paragraph_count() - 2; - assert!(tb.para_at(last).list.is_some(), "the locked frame's paragraphs stay a list (ids named: {named})"); - assert!(!tb.plain_text().ends_with("\u{2022}\tAlpha beta.\n")); - assert!(s.tool_options().get("story").is_some(), "the whole story stays selected"); +fn convert_to_text_of_the_whole_story_converts_locked_and_hidden_frames() { + // Over MCP without ids, as the Paragraph panel sends it with every frame of the story, and with + // ids naming only the held frame. + for command in ["object.lock", "object.hide"] { + for held_first in [false, true] { + for call in ["none", "story", "held"] { + let (mut s, a, b, story) = threaded_list_edited_in_its_second_frame(); + let (held, other) = if held_first { (a, b) } else { (b, a) }; + let unrelated = + s.execute("text.create", &json!({"x": 10, "y": 500, "text": "One\nTwo", "size": 12})).unwrap()["id"].as_u64().unwrap(); + let unrelated = NodeId(unrelated); + s.execute("text.setFormat", &json!({"ids": [unrelated.0], "list": "bullet"})).unwrap(); + let unrelated_before = obj(&s, unrelated); + s.execute(command, &json!({"ids": [held.0]})).unwrap(); + s.execute("select.set", &json!({"ids": [other.0]})).unwrap(); + s.select_tool("type", ViewInfo::default()).unwrap(); + s.set_tool_option("textSelection", &json!({"editing": other.0, "anchor": 0, "caret": 0})); + assert_eq!(s.execute("select.all", &json!({})).unwrap()["story"], json!([a.0, b.0])); + let case = format!("{command}, held first: {held_first}, ids: {call}"); + let p = match call { + "none" => json!({}), + "story" => json!({"ids": [a.0, b.0]}), + _ => json!({"ids": [held.0]}), + }; + let steps = undo_labels(&s).len(); + let r = s.execute("text.convertListToText", &p).unwrap(); + assert_eq!(undo_labels(&s).len(), steps + 1, "{case}: one undo step"); + assert!(r["ids"].as_array().unwrap().contains(&json!(held.0)), "{case}: the held frame is changed"); + assert!(no_list(&s, held), "{case}: the held frame leaves its list"); + assert_eq!(obj(&s, unrelated), unrelated_before, "{case}: other type is as it was"); + if call == "held" { + // The other frame's paragraphs whose text starts there keep their list. + assert!(!no_list(&s, other), "{case}: the frame not named keeps its list"); + continue; + } + assert!(no_list(&s, other), "{case}: the other frame leaves its list"); + assert_eq!(bullet_chars(&s, &[a, b]), 12, "{case}: each paragraph's bullet is held once as characters"); + assert!(s.tool_options().get("story").is_some(), "{case}: the whole story stays selected"); + // Nothing is a list any more: another call changes nothing and adds no undo step. + s.execute("text.convertListToText", &p).unwrap(); + assert_eq!(undo_labels(&s).len(), steps + 1, "{case}: no undo step when nothing changes"); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(format!("{}{}", obj(&s, a).plain_text(), obj(&s, b).plain_text()), story, "{case}: undo restores the text"); + assert!(!no_list(&s, a) && !no_list(&s, b), "{case}: undo restores the lists"); + } + } } } #[test] -fn convert_to_text_of_the_whole_story_leaves_a_paragraph_that_starts_in_a_locked_frame() { - for named in [false, true] { +fn convert_to_text_of_the_whole_story_converts_a_paragraph_that_runs_across_a_locked_frame() { + // The paragraph that runs from the first frame into the second starts in the locked frame, or + // ends in it. + for (named, lock_first) in [(false, true), (true, true), (false, false), (true, false)] { let mut s = session(); let story = format!("Alpha beta.\nAlpha beta.\n{}end.\nAlpha beta.\nAlpha beta.\n", "Gamma delta ".repeat(40)); let a = NodeId( @@ -2354,22 +2415,23 @@ fn convert_to_text_of_the_whole_story_leaves_a_paragraph_that_starts_in_a_locked s.execute("text.setFormat", &json!({"ids": [a.0, b.0], "list": "bullet"})).unwrap(); let in_a = obj(&s, a).plain_text(); assert!(!in_a.ends_with('\n') && !obj(&s, b).plain_text().starts_with('\n'), "a paragraph runs on from the first frame into the second"); - s.execute("object.lock", &json!({"ids": [a.0]})).unwrap(); - s.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + let (locked, other) = if lock_first { (a, b) } else { (b, a) }; + s.execute("object.lock", &json!({"ids": [locked.0]})).unwrap(); + s.execute("select.set", &json!({"ids": [other.0]})).unwrap(); s.select_tool("type", ViewInfo::default()).unwrap(); - s.set_tool_option("textSelection", &json!({"editing": b.0, "anchor": 0, "caret": 0})); + s.set_tool_option("textSelection", &json!({"editing": other.0, "anchor": 0, "caret": 0})); assert_eq!(s.execute("select.all", &json!({})).unwrap()["story"], json!([a.0, b.0])); + let case = format!("ids named: {named}, first frame locked: {lock_first}"); let p = if named { json!({"ids": [a.0, b.0]}) } else { json!({}) }; let r = s.execute("text.convertListToText", &p).unwrap(); - assert_eq!(r["ids"], json!([b.0]), "only the editable frame is changed (ids named: {named})"); - // The two paragraphs that start in the editable frame, and the empty one that ends the story. - assert_eq!(r["converted"], json!(3), "only the paragraphs that start in the editable frame convert"); + assert_eq!(r["ids"], json!([a.0, b.0]), "{case}: both frames are changed"); + // The five paragraphs with text, and the empty one that ends the story. + assert_eq!(r["converted"], json!(6), "{case}: every paragraph of the story converts"); let (ta, tb) = (obj(&s, a), obj(&s, b)); - assert_eq!(ta.plain_text(), in_a, "the locked frame's text is as it was"); - assert!((0..ta.paragraph_count()).all(|k| ta.para_at(k).list.is_some()), "the locked frame stays a list"); - assert!(tb.para_at(0).list.is_some(), "the paragraph the locked frame starts stays a list"); - assert!(!tb.plain_text().starts_with('\u{2022}')); - assert_eq!(tb.plain_text().matches("\u{2022}\t").count(), 2); + assert!(no_list(&s, a) && no_list(&s, b), "{case}: the story leaves its list"); + assert_eq!(bullet_chars(&s, &[a, b]), 5, "{case}: each paragraph's bullet is held once as characters"); + assert!(ta.plain_text().contains("\u{2022}\tGamma"), "{case}: the paragraph across the frames takes its bullet where its text starts"); + assert!(!tb.plain_text().starts_with('\u{2022}'), "{case}"); } } diff --git a/docs/mcp.md b/docs/mcp.md index f756bc8c97..727a29794f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8973,9 +8973,8 @@ the type it changed, how many paragraphs were `converted`, and the characters `i Type tool edits, `text.convertListToText` ends its typing first and moves its anchor and caret past the characters inserted at or before them, whether the call comes from the menu, MCP or the control channel. After Select All in a frame of threaded text, a call without `ids`, `id`, `start` or `end` converts every paragraph of -the story's frames that are neither locked nor hidden. While the story is selected, its locked and hidden frames are -not converted, even when `ids` names them, and neither is a paragraph whose text starts in one. When the call converts -all of its other frames, the whole story stays selected. +every frame of the story, locked and hidden frames included. `ids` naming a locked or hidden frame converts its +paragraphs too. When the call converts every frame of the story, the whole story stays selected. In threaded type, when the caret's character moved to another frame, the Type tool edits that frame with the caret next to the same character, and that frame becomes the selection when it was not selected. @@ -10665,7 +10664,8 @@ glyph of its first character lands where it was drawn. they were. Character styles stay; the object takes the top-left piece's place and paint. Returns `{id, joined, lines}`. - `addon.cleanup.removeBreaks {kind, ids?}` removes the forced line breaks (`kind: "line"`) or paragraph returns (`"paragraph"`) in the characters selected with a Type tool, else in all the text of the selected type. After - Select All in a frame of threaded text, it removes them from the text of every frame of the story, as one undo step. + Select All in a frame of threaded text, it removes them from the text of every frame of the story, locked and hidden + frames included, as one undo step. A break between two words becomes a space; merged paragraphs take the first one's paragraph style. The frames of a threaded story, selected all together or through Select All, are read as one text, so a break at the end of one frame before a word in the next one also becomes a space. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 296bd84b2b..b8258aece0 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -993,7 +993,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - On Windows and Linux, F2, F3 and F4 run Cut, Copy and Paste alongside Ctrl+X, Ctrl+C and Ctrl+V, and in the web build they do so everywhere except macOS. The Edit menu keeps the Ctrl shortcuts, and Keyboard Shortcuts lists both keys of each row. On macOS only Cmd+X, Cmd+C and Cmd+V are the defaults. F2, F3 and F4 do not run these commands in a focused text field or while the Type tool edits text. A saved shortcut set that assigns one of these keys to another command keeps that assignment. Public reference: [Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html). - Cmd/Ctrl+A follows the keyboard: in a panel, dialog or search field it selects the field's text, while the Type tool edits it selects all of that text (also `select.all` over MCP), and only otherwise every object. On macOS the menu bar's Select All, Cut, Copy and Paste (keys or clicks) act on a focused field too, and elsewhere the in-window menus' do: the field that had the keyboard when the menu opened gets them, with its selection, and the keyboard back (#516). Not yet: Select All across threaded frames (one frame's text is selected). - Cmd/Ctrl+A follows the keyboard: in a panel, dialog or search field it selects the field's text, while the Type tool edits it selects all of that text (also `select.all` over MCP), and only otherwise every object. On macOS the menu bar's Select All, Cut, Copy and Paste (keys or clicks) act on a focused field too, and elsewhere the in-window menus' do: the field that had the keyboard when the menu opened gets them, with its selection, and the keyboard back (#516). In a frame of threaded text, Select All selects the whole story, highlighted in every frame: Copy and Cut take all of it, typing or Delete replaces it as one undo step, and a fill, a size step or a Character or Paragraph panel change applies to every frame's text (VectorCraft's own behavior; `textedit::select_all_in_a_threaded_frame_selects_the_whole_story`, `textedit::typing_over_the_whole_story_replaces_every_frames_text_in_one_step`). - - With the whole story of threaded text selected by Select All, Remove Line Breaks, Remove Paragraph Breaks and Type › Bullets and Numbering › Convert to Text act on the text of every frame as one undo step, and the story stays selected after Convert to Text; a selection inside one frame changes only that frame (VectorCraft's own behavior; `textedit::remove_breaks_takes_the_whole_story_that_select_all_selected`, `textedit::convert_to_text_takes_the_whole_story_that_select_all_selected`). + - With the whole story of threaded text selected by Select All, Remove Line Breaks, Remove Paragraph Breaks and Type › Bullets and Numbering › Convert to Text act on the text of every frame as one undo step, locked and hidden frames included, and the story stays selected after Convert to Text; a selection inside one frame changes only that frame (VectorCraft's own behavior; `textedit::remove_breaks_takes_the_whole_story_that_select_all_selected`, `textedit::convert_to_text_takes_the_whole_story_that_select_all_selected`, `textedit::convert_to_text_of_the_whole_story_converts_locked_and_hidden_frames`, `textedit::remove_breaks_of_the_whole_story_takes_locked_and_hidden_frames`). - With the whole story of threaded text selected by Select All, the Character, Paragraph, OpenType, Tabs and Text Styles panels, the Justification dialog and the font menu change the frames that are in the edited frame's thread at the time of the change, locked and hidden frames included. A frame that has left the thread is not changed, and a frame added to the thread is (VectorCraft's own behavior; `panels::character::tests::story_changes_follow_the_edited_frames_thread_after_the_first_saved_frame_leaves`, `story_changes_leave_out_a_frame_that_left_and_take_in_a_frame_that_joined`, `story_changes_stay_in_the_edited_frame_once_its_thread_is_removed`, `story_changes_take_in_locked_and_hidden_frames`, `panels::tabs::tests::indent_markers_after_select_all_keep_each_story_paragraphs_indents`, `dialogs::justification::tests::justification_dialog_follows_the_story_thread_at_ok`). - With the whole story of threaded text selected by Select All, the Character, Paragraph, OpenType, Tabs and Text Styles panels, the Justification dialog and the font menu change the frames that are in the edited frame's thread at the time of the change, locked and hidden frames included. A frame that has left the thread is not changed, and a frame added to the thread is (VectorCraft's own behavior; `panels::character::tests::story_changes_follow_the_edited_frames_thread_after_the_first_saved_frame_leaves`, `story_changes_leave_out_a_frame_that_left_and_take_in_a_frame_that_joined`, `story_changes_stay_in_the_edited_frame_once_its_thread_is_removed`, `story_changes_take_in_locked_and_hidden_frames`). - Switching from a Type tool to the Eyedropper keeps a whole story selected by Select All: a pick applies to the text of every frame as one undo step, and switching back restores the story selection (VectorCraft's own behavior; `textedit::switching_to_the_eyedropper_keeps_the_whole_story_selected`).