Skip to content

Commit 4da6ec2

Browse files
allenwpWhalesState
authored andcommitted
Forced fixed undo history to make editor shortcuts use global history.
Fixes godotengine#76851.
1 parent 81fedac commit 4da6ec2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

editor/editor_settings_dialog.cpp

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

358358
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
359-
undo_redo->create_action(vformat(TTR("Edit Shortcut: %s"), p_path));
359+
undo_redo->create_action(vformat(TTR("Edit Shortcut: %s"), p_path), UndoRedo::MERGE_DISABLE, EditorSettings::get_singleton());
360+
// History must be fixed based on the EditorSettings object because current_sc would
361+
// incorrectly make this action use the scene history.
362+
undo_redo->force_fixed_history();
360363
undo_redo->add_do_method(current_sc.ptr(), "set_events", p_events);
361364
undo_redo->add_undo_method(current_sc.ptr(), "set_events", current_sc->get_events());
362365
undo_redo->add_do_method(EditorSettings::get_singleton(), "mark_setting_changed", "shortcuts");

0 commit comments

Comments
 (0)