forked from 1b-agent/opencadstudio-upstream
Merge pull request #1785 from ramox81/codex/selection-found-messages
Selection: report what each pick found while a command gathers objects Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # src/locale_catalog.rs
This commit is contained in:
commit
b5fb42e9f8
28 files changed
+171
-16
No files matched your search
@@ -158,17 +158,10 @@ impl CadCommand for CountCommand {
|
||||
}
|
||||
|
||||
fn on_selection_complete(&mut self, handles: Vec<Handle>) -> CmdResult {
|
||||
// The selection arrives whole after every pick: `1 found`, then
|
||||
// `1 found, 2 total`.
|
||||
let found = handles.iter().filter(|h| !self.targets.contains(h)).count();
|
||||
let first = self.targets.is_empty();
|
||||
// The selection arrives whole after every pick; the driver reports
|
||||
// what each pick found.
|
||||
self.targets = handles;
|
||||
let total = self.targets.len();
|
||||
CmdResult::ReportMeasurement(if first {
|
||||
crate::tf!("{found} found").into_owned()
|
||||
} else {
|
||||
crate::tf!("{found} found, {total} total").into_owned()
|
||||
})
|
||||
CmdResult::NeedPoint
|
||||
}
|
||||
|
||||
fn needs_entity_pick(&self) -> bool {
|
||||
|
||||
Reference in new issue
Block a user