Fix Command_Open jumping to beginning every time

This commit is contained in:
Krzosa Karol
2025-05-13 09:11:42 +02:00
parent f7f2aafc56
commit 2e9147c47d
3 changed files with 11 additions and 4 deletions

View File

@@ -67,7 +67,7 @@ function IsAlpha(a)
end
function SkipLineAndColumn(s)
local line, col = "1", "1"
local line, col = "-1", "-1"
function parse_line_and_column(line_and_col, delimiter)
ic, jc = line_and_col:find(delimiter)

View File

@@ -381,7 +381,6 @@ function KeybindsFKeys(e)
if e.key == FKeySDLK[i] then
local cmdline = FKey[i]
if type(cmdline) == "function" then cmdline = FKey[i]() end
Print(cmdline)
Cmd { working_dir = GetWorkDir(), kind = "console", cmd = cmdline }
return true
end

View File

@@ -320,8 +320,16 @@ OnOpenResult CallOnOpen(String path, String meta) {
result.cmd = cmd;
result.working_dir = working_dir;
result.file_path = file_path;
if (col_string.len) result.col = strtoll(col_string.data, NULL, 10);
if (line_string.len) result.line = strtoll(line_string.data, NULL, 10);
if (col_string.len) {
result.col = strtoll(col_string.data, NULL, 10);
} else {
result.col = -1;
}
if (line_string.len) {
result.line = strtoll(line_string.data, NULL, 10);
} else {
result.line = -1;
}
result.kind = kind;
return result;