mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-09 10:47:27 +00:00
Shape Builder: Find Objects with select waits for a pending merge
document.find is a query, so it ran at once while a Shape Builder merge was still being computed. With select it changes the selection, and the pending merge was then discarded. It now applies the merge first, as the other queries that select do. The command sweep also runs document.find with a filter and select, which one key at a time does not reach.
This commit is contained in:
@@ -64,11 +64,12 @@ pub(crate) fn strip_replay_only(id: &str, p: &mut Value) {
|
||||
}
|
||||
|
||||
/// Queries that apply the edit the active tool is computing before they run, as edits do
|
||||
/// ([`Session::finish_tool_edit`]): a batch runs edits, Select All Instances and Lock Guides
|
||||
/// change the selection, and the proof views, the preferences and added fonts give the documents
|
||||
/// new revisions (they draw again, and type lays out again).
|
||||
/// ([`Session::finish_tool_edit`]): a batch runs edits, Find Objects with `select`, Select All
|
||||
/// Instances and Lock Guides change the selection, and the proof views, the preferences and added
|
||||
/// fonts give the documents new revisions (they draw again, and type lays out again).
|
||||
const WAIT_FOR_TOOL_EDIT: &[&str] = &[
|
||||
"command.batch",
|
||||
"document.find",
|
||||
"symbol.selectInstances",
|
||||
"view.guides.lock",
|
||||
"view.proofSetup",
|
||||
|
||||
@@ -250,6 +250,10 @@ fn commands_that_do_not_wait_for_a_tool_edit_change_no_document() {
|
||||
cases.push(json!({ k.as_str(): v }));
|
||||
}
|
||||
}
|
||||
// Find Objects selects only with a filter, which one key at a time does not give it.
|
||||
if c.id == "document.find" {
|
||||
cases.extend([json!({"kind": "Path", "select": true}), json!({"name": "no such name", "select": true})]);
|
||||
}
|
||||
for p in &cases {
|
||||
let mut s = fx.session();
|
||||
let before = tool_edit_state(&s);
|
||||
|
||||
Reference in New Issue
Block a user