aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
authorIgnacio Etcheverry2018-01-09 17:19:37 +0100
committerIgnacio Etcheverry2018-01-09 17:25:23 +0100
commit1c6269f2dd3e1a46dbb6a36c3363c9c535be8b64 (patch)
treee66c28aba939862ca7971c9c093db6f16ac0977d /editor/plugins/script_editor_plugin.cpp
parent5be356b72f5b765cdec069c2c4a4011a42fabc47 (diff)
downloadgodot-1c6269f2dd3e1a46dbb6a36c3363c9c535be8b64.tar.gz
godot-1c6269f2dd3e1a46dbb6a36c3363c9c535be8b64.tar.zst
godot-1c6269f2dd3e1a46dbb6a36c3363c9c535be8b64.zip
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r--editor/plugins/script_editor_plugin.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 51954a24d..f99768400 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -313,24 +313,22 @@ void ScriptEditor::_goto_script_line2(int p_line) {
void ScriptEditor::_goto_script_line(REF p_script, int p_line) {
- editor->push_item(p_script.ptr());
+ Ref<Script> script = Object::cast_to<Script>(*p_script);
+ if (!script.is_null() && script->get_path().is_resource_file()) {
+ if (edit(p_script, p_line, 0)) {
+ editor->push_item(p_script.ptr());
- if (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) {
-
- Ref<Script> script = Object::cast_to<Script>(*p_script);
- if (!script.is_null() && script->get_path().is_resource_file())
- edit(p_script, p_line, 0);
- }
-
- int selected = tab_container->get_current_tab();
- if (selected < 0 || selected >= tab_container->get_child_count())
- return;
+ int selected = tab_container->get_current_tab();
+ if (selected < 0 || selected >= tab_container->get_child_count())
+ return;
- ScriptEditorBase *current = Object::cast_to<ScriptEditorBase>(tab_container->get_child(selected));
- if (!current)
- return;
+ ScriptEditorBase *current = Object::cast_to<ScriptEditorBase>(tab_container->get_child(selected));
+ if (!current)
+ return;
- current->goto_line(p_line, true);
+ current->goto_line(p_line, true);
+ }
+ }
}
void ScriptEditor::_update_history_arrows() {