diff --git a/src/lib/commands.js b/src/lib/commands.js index a8de5d3c2..960baf828 100644 --- a/src/lib/commands.js +++ b/src/lib/commands.js @@ -139,14 +139,17 @@ export default { showFileInfo(url); }, async goto() { - const res = await prompt(strings["enter line number"], "", "number", { + const lastLine = editorManager.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); + editorManager.editor.gotoLine(lineStr, colStr); }, async "new-file"() { let filename = await prompt(strings["enter file name"], "", "filename", {