Remove redo; undo rename on a device
Redo is gone in both file and device mode: the Edit menu entry, Ctrl/Cmd+Y and Ctrl/Cmd+Shift+Z, and the redo stack. An undone step is dropped. Undoing past the last save now leaves the saved depth unreachable, so a new edit cannot be mistaken for the saved state. Renames on a device are undoable: LiveRenameCommand renames back on the device first, and warns and clears history if the device refuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+6
-5
@@ -462,11 +462,12 @@ def rename_component(comp_element, new_name):
|
||||
for link, attr, _, new_ref in link_changes:
|
||||
link.set(attr, new_ref)
|
||||
|
||||
if not app_state.live_mode:
|
||||
undo.push(undo.RenameComponentCommand(
|
||||
comp_element, old_name, new_name, link_changes,
|
||||
label=f"rename {old_name} to {new_name}"
|
||||
))
|
||||
command_class = (undo.LiveRenameCommand if app_state.live_mode
|
||||
else undo.RenameComponentCommand)
|
||||
undo.push(command_class(
|
||||
comp_element, old_name, new_name, link_changes,
|
||||
label=f"rename {old_name} to {new_name}"
|
||||
))
|
||||
|
||||
app_state.mark_dirty()
|
||||
refresh_treeview_from_dom(root)
|
||||
|
||||
Reference in New Issue
Block a user