summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_interface.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/editor/editor_interface.cpp b/editor/editor_interface.cpp
index 8d63082f31..94040d4ca0 100644
--- a/editor/editor_interface.cpp
+++ b/editor/editor_interface.cpp
@@ -289,7 +289,7 @@ void EditorInterface::edit_node(Node *p_node) {
}
void EditorInterface::edit_script(const Ref<Script> &p_script, int p_line, int p_col, bool p_grab_focus) {
- ScriptEditor::get_singleton()->edit(p_script, p_line, p_col, p_grab_focus);
+ ScriptEditor::get_singleton()->edit(p_script, p_line - 1, p_col - 1, p_grab_focus);
}
void EditorInterface::open_scene_from_path(const String &scene_path) {
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 78ba26503d..67df349e48 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2332,7 +2332,7 @@ bool ScriptEditor::edit(const Ref<Resource> &p_resource, int p_line, int p_col,
}
if (p_line > 0) {
- se->goto_line(p_line - 1);
+ se->goto_line(p_line);
}
}
_update_script_names();
@@ -2427,8 +2427,8 @@ bool ScriptEditor::edit(const Ref<Resource> &p_resource, int p_line, int p_col,
_test_script_times_on_disk(p_resource);
_update_modified_scripts_for_external_editor(p_resource);
- if (p_line > 0) {
- se->goto_line(p_line - 1);
+ if (p_line >= 0) {
+ se->goto_line(p_line);
}
notify_script_changed(p_resource);