From 2d4f03d18b0eabd6747322a530371e6e5fe892b4 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Fri, 27 Mar 2026 12:45:22 +0530 Subject: [PATCH 1/2] fix(commands): show line range in goto prompt --- src/lib/commands.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/commands.js b/src/lib/commands.js index a8de5d3c2..bd8a3d9c5 100644 --- a/src/lib/commands.js +++ b/src/lib/commands.js @@ -139,13 +139,17 @@ export default { showFileInfo(url); }, async goto() { - const res = await prompt(strings["enter line number"], "", "number", { + const { editor } = editorManager; + const lastLine = editor?.state?.doc?.lines; + const message = lastLine + ? `${strings["enter line number"]} (1..${lastLine})` + : strings["enter line number"]; + const res = await prompt(message, "", "number", { placeholder: "line.column", }); if (!res) return; const [lineStr, colStr] = String(res).split("."); - const { editor } = editorManager; editor.gotoLine(lineStr, colStr); }, async "new-file"() { From 3e6cc7434d887df6cdda5db57b185ee77b86a8fd Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Fri, 27 Mar 2026 12:51:58 +0530 Subject: [PATCH 2/2] fix --- src/lib/commands.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/commands.js b/src/lib/commands.js index bd8a3d9c5..960baf828 100644 --- a/src/lib/commands.js +++ b/src/lib/commands.js @@ -139,8 +139,7 @@ export default { showFileInfo(url); }, async goto() { - const { editor } = editorManager; - const lastLine = editor?.state?.doc?.lines; + const lastLine = editorManager.editor?.state?.doc?.lines; const message = lastLine ? `${strings["enter line number"]} (1..${lastLine})` : strings["enter line number"]; @@ -150,7 +149,7 @@ export default { if (!res) return; const [lineStr, colStr] = String(res).split("."); - editor.gotoLine(lineStr, colStr); + editorManager.editor.gotoLine(lineStr, colStr); }, async "new-file"() { let filename = await prompt(strings["enter file name"], "", "filename", {