Skip to content

Commit

Permalink
Merge pull request #84284 from Haydoggo/script-switch
Browse files Browse the repository at this point in the history
Preserve inspector focus when opening script from scene tree
  • Loading branch information
akien-mga committed Jan 4, 2024
2 parents 1312a73 + 887fd08 commit bb1006b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,9 @@ void SceneTreeDock::_load_request(const String &p_path) {
}

void SceneTreeDock::_script_open_request(const Ref<Script> &p_script) {
EditorNode::get_singleton()->edit_resource(p_script);
if (ScriptEditor::get_singleton()->edit(p_script, true)) {
EditorNode::get_singleton()->editor_select(EditorNode::EDITOR_SCRIPT);
}
}

void SceneTreeDock::_push_item(Object *p_object) {
Expand Down

0 comments on commit bb1006b

Please sign in to comment.