From 5c94b2e662c049df5949f89eda93b11a54425f7e Mon Sep 17 00:00:00 2001 From: Malcolm Anderson Date: Sat, 21 Jun 2025 11:19:44 -0700 Subject: [PATCH] Use one-based line numbers for external text editors --- editor/plugins/script_editor_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index d0c3a9d9aa5..740bbd8458a 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2503,8 +2503,8 @@ bool ScriptEditor::edit(const Ref &p_resource, int p_line, int p_col, if (flags.size()) { String project_path = ProjectSettings::get_singleton()->get_resource_path(); - flags = flags.replacen("{line}", itos(p_line > 0 ? p_line : 0)); - flags = flags.replacen("{col}", itos(p_col)); + flags = flags.replacen("{line}", itos(MAX(p_line + 1, 1))); + flags = flags.replacen("{col}", itos(p_col + 1)); flags = flags.strip_edges().replace("\\\\", "\\"); int from = 0;