From 9ca440b7636daa41c36bba0544fb9dc50e993009 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sun, 17 Mar 2019 19:47:04 +0000 Subject: [PATCH] Fix script editor attempting to set current line to -1 on script open (cherry picked from commit 6f6d4a6c2ec035529c057f85d893a9c142670b74) --- editor/plugins/script_editor_plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index f632ee0e7bb..89e3327a3aa 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1956,8 +1956,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; } @@ -2017,8 +2018,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());