@ -2035,9 +2035,10 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
Object * prev_inspected_object = get_inspector ( ) - > get_edited_object ( ) ;
Object * prev_inspected_object = get_inspector ( ) - > get_edited_object ( ) ;
bool disable_folding = bool ( EDITOR_GET ( " interface/inspector/disable_folding " ) ) ;
bool disable_folding = bool ( EDITOR_GET ( " interface/inspector/disable_folding " ) ) ;
bool stay_in_script_editor_on_node_selected = bool ( EDITOR_GET ( " text_editor/navigation/stay_in_script_editor_on_node_selected " ) ) ;
bool is_resource = current_obj - > is_class ( " Resource " ) ;
bool is_resource = current_obj - > is_class ( " Resource " ) ;
bool is_node = current_obj - > is_class ( " Node " ) ;
bool is_node = current_obj - > is_class ( " Node " ) ;
bool stay_in_script_editor_on_node_selected = bool ( EDITOR_GET ( " text_editor/navigation/stay_in_script_editor_on_node_selected " ) ) ;
bool skip_main_plugin = false ;
String editable_warning ; //none by default
String editable_warning ; //none by default
@ -2074,8 +2075,8 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
node_dock - > set_node ( current_node ) ;
node_dock - > set_node ( current_node ) ;
scene_tree_dock - > set_selected ( current_node ) ;
scene_tree_dock - > set_selected ( current_node ) ;
inspector_dock - > update ( current_node ) ;
inspector_dock - > update ( current_node ) ;
if ( ! inspector_only ) {
if ( ! inspector_only & & ! skip_main_plugin ) {
inspector_only = stay_in_script_editor_on_node_selected & & ScriptEditor : : get_singleton ( ) - > is_visible_in_tree ( ) ;
skip_main_plugin = stay_in_script_editor_on_node_selected & & ScriptEditor : : get_singleton ( ) - > is_visible_in_tree ( ) ;
}
}
} else {
} else {
node_dock - > set_node ( nullptr ) ;
node_dock - > set_node ( nullptr ) ;
@ -2151,7 +2152,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
}
}
}
}
if ( main_plugin ) {
if ( main_plugin & & ! skip_main_plugin ) {
// special case if use of external editor is true
// special case if use of external editor is true
Resource * current_res = Object : : cast_to < Resource > ( current_obj ) ;
Resource * current_res = Object : : cast_to < Resource > ( current_obj ) ;
if ( main_plugin - > get_name ( ) = = " Script " & & current_obj - > get_class_name ( ) ! = StringName ( " VisualScript " ) & & current_res & & ! current_res - > get_path ( ) . empty ( ) & & current_res - > get_path ( ) . find ( " :: " ) = = - 1 & & ( bool ( EditorSettings : : get_singleton ( ) - > get ( " text_editor/external/use_external_editor " ) ) | | overrides_external_editor ( current_obj ) ) ) {
if ( main_plugin - > get_name ( ) = = " Script " & & current_obj - > get_class_name ( ) ! = StringName ( " VisualScript " ) & & current_res & & ! current_res - > get_path ( ) . empty ( ) & & current_res - > get_path ( ) . find ( " :: " ) = = - 1 & & ( bool ( EditorSettings : : get_singleton ( ) - > get ( " text_editor/external/use_external_editor " ) ) | | overrides_external_editor ( current_obj ) ) ) {