forked from 1b-agent/opencadstudio-upstream
Block Attribute Manager: one undo step per Apply
Live changes are taken back quietly before Apply, OK or Sync write the list again, so each leaves exactly one undo step even when something closed the open live step in between; Cancel takes them back without a command-line notice. References keep their values through renames made live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4726c775bf
commit
3bd828d0f5
3 files changed
+54
-28
No files matched your search
+10
-2
@@ -1287,6 +1287,12 @@ impl OpenCADStudio {
|
||||
}
|
||||
|
||||
pub(super) fn undo_steps(&mut self, steps: usize) {
|
||||
self.undo_steps_reported(steps, true);
|
||||
}
|
||||
|
||||
/// [`Self::undo_steps`]; `report` false takes the steps back without
|
||||
/// the command-line notice (a dialog withdrawing its own live changes).
|
||||
pub(super) fn undo_steps_reported(&mut self, steps: usize, report: bool) {
|
||||
let i = self.active_tab;
|
||||
self.finish_pending_history(i);
|
||||
let available = self.tabs[i].history.undo_stack.len();
|
||||
@@ -1353,8 +1359,10 @@ impl OpenCADStudio {
|
||||
native_graph_changed,
|
||||
&changes,
|
||||
);
|
||||
self.command_line
|
||||
.push_output(crate::tf!("Undo: {last_label}").as_ref());
|
||||
if report {
|
||||
self.command_line
|
||||
.push_output(crate::tf!("Undo: {last_label}").as_ref());
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn redo_steps(&mut self, steps: usize) {
|
||||
|
||||
Reference in new issue
Block a user