summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-03-18 23:26:07 -0700
committerGitHub <noreply@github.com>2019-03-18 23:26:07 -0700
commita90a8eb34b0a368af928c3c1aebfdf8fb7211f72 (patch)
tree2134711359a9a09c6815466502c9e22e9adf3d11 /editor
parentdf7d3708c5b535c3696943322a14ec19a175e30c (diff)
parent6f6d4a6c2ec035529c057f85d893a9c142670b74 (diff)
Merge pull request #27180 from Paulb23/script_editor_edit_line_0
Fix script editor attempting to set current line to -1 on script open
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/script_editor_plugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index e648fa0820..9e6459e41f 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1951,8 +1951,9 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra
if (is_visible_in_tree())
se->ensure_focus();
- if (p_line >= 0)
+ if (p_line > 0) {
se->goto_line(p_line - 1);
+ }
}
return true;
}
@@ -2012,8 +2013,9 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra
_test_script_times_on_disk(p_resource);
_update_modified_scripts_for_external_editor(p_resource);
- if (p_line >= 0)
+ if (p_line > 0) {
se->goto_line(p_line - 1);
+ }
notify_script_changed(p_resource);
_add_recent_script(p_resource->get_path());