Skip to content

Commit 85be143

Browse files
committed
EditorUndoRedoManager: Use fixed history when a custom context is provided.
This makes the custom context feature of the `EditorUndoRedoManager` behave consistently with the current documentation. Fixes godotengine#100108. Also fixes godotengine#76851 by providing a custom context when creating the "Edit Shortcut" action.
1 parent 1f47e4c commit 85be143

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

editor/editor_settings_dialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ void EditorSettingsDialog::_update_shortcut_events(const String &p_path, const A
332332
Ref<Shortcut> current_sc = EditorSettings::get_singleton()->get_shortcut(p_path);
333333

334334
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
335-
undo_redo->create_action(vformat(TTR("Edit Shortcut: %s"), p_path));
335+
undo_redo->create_action(vformat(TTR("Edit Shortcut: %s"), p_path), UndoRedo::MERGE_DISABLE, EditorSettings::get_singleton());
336336
undo_redo->add_do_method(current_sc.ptr(), "set_events", p_events);
337337
undo_redo->add_undo_method(current_sc.ptr(), "set_events", current_sc->get_events());
338338
undo_redo->add_do_method(EditorSettings::get_singleton(), "mark_setting_changed", "shortcuts");

editor/editor_undo_redo_manager.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ void EditorUndoRedoManager::create_action(const String &p_name, UndoRedo::MergeM
150150
if (p_custom_context) {
151151
// This assigns history to pending action.
152152
get_history_for_object(p_custom_context);
153+
force_fixed_history();
153154
}
154155
}
155156

0 commit comments

Comments
 (0)