diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2017-09-04 08:12:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-04 08:12:29 +0200 |
| commit | b5d2d0a9a502416a03f303fc30bee8a7ec8e93e2 (patch) | |
| tree | 754f5946625e043fedbdb83503e52d2c9fbe3159 /editor/editor_node.cpp | |
| parent | 0f5e575d6026ff4f6d8a4d28fbd8e7eca77aeef5 (diff) | |
| parent | 52a7be4eefbafcc983766bd80a87752b678c1c17 (diff) | |
Merge pull request #10939 from neikeq/fix-overridden-external-editors
Fixes language overridden external editors
Diffstat (limited to 'editor/editor_node.cpp')
| -rw-r--r-- | editor/editor_node.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 6b5db7572a..d4e0aacb0f 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1368,6 +1368,16 @@ void EditorNode::_set_editing_top_editors(Object *p_current_object) { editor_plugins_over->edit(p_current_object); } +static bool overrides_external_editor(Object *p_object) { + + Script *script = Object::cast_to<Script>(p_object); + + if (!script) + return false; + + return script->get_language()->overrides_external_editor(); +} + void EditorNode::_edit_current() { uint32_t current = editor_history.get_current(); @@ -1434,7 +1444,7 @@ void EditorNode::_edit_current() { if (main_plugin) { // special case if use of external editor is true - if (main_plugin->get_name() == "Script" && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) { + if (main_plugin->get_name() == "Script" && (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) { main_plugin->edit(current_obj); } @@ -1442,6 +1452,7 @@ void EditorNode::_edit_current() { // update screen main_plugin if (!changing_scene) { + if (editor_plugin_screen) editor_plugin_screen->make_visible(false); editor_plugin_screen = main_plugin; |