{"record":{"id":"be6ca7a620311f27","repo":"micro-editor/micro","slug":"not-enough-arguments","errorCode":null,"errorMessage":"Not enough arguments","messagePattern":"Not enough arguments","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/action/command.go","lineNumber":948,"sourceCode":"\tline, col, err := h.parseLineCol(args)\n\tif err != nil {\n\t\tInfoBar.Error(err)\n\t\treturn\n\t}\n\n\tline = h.Buf.GetActiveCursor().Y + 1 + line\n\tline = util.Clamp(line-1, 0, h.Buf.LinesNum()-1)\n\tcol = util.Clamp(col-1, 0, util.CharacterCount(h.Buf.LineBytes(line)))\n\n\th.RemoveAllMultiCursors()\n\th.Cursor.Deselect(true)\n\th.GotoLoc(buffer.Loc{col, line})\n}\n\n// parseLineCol is a helper to parse the input of GotoCmd and JumpCmd\nfunc (h *BufPane) parseLineCol(args []string) (line int, col int, err error) {\n\tif len(args) <= 0 {\n\t\treturn 0, 0, errors.New(\"Not enough arguments\")\n\t}\n\n\tline, col = 0, 0\n\tif strings.Contains(args[0], \":\") {\n\t\tparts := strings.SplitN(args[0], \":\", 2)\n\t\tline, err = strconv.Atoi(parts[0])\n\t\tif err != nil {\n\t\t\treturn 0, 0, err\n\t\t}\n\t\tcol, err = strconv.Atoi(parts[1])\n\t\tif err != nil {\n\t\t\treturn 0, 0, err\n\t\t}\n\t} else {\n\t\tline, err = strconv.Atoi(args[0])\n\t\tif err != nil {\n\t\t\treturn 0, 0, err\n\t\t}","sourceCodeStart":930,"sourceCodeEnd":966,"githubUrl":"https://github.com/micro-editor/micro/blob/1c8b82b32e408a5faf340039ed92d5266bea3293/internal/action/command.go#L930-L966","documentation":"Returned by (*BufPane).parseLineCol (internal/action/command.go:948) when the args slice is empty. parseLineCol is the shared argument parser for GotoCmd (:goto, command.go:909) and JumpCmd (:jump, command.go:930); it expects at least one argument shaped 'line' or 'line:col' (also ':col'). Zero arguments means the command was invoked bare, so it refuses instead of defaulting.","triggerScenarios":"Executing > goto or > jump with no arguments in the command bar; a Lua macro calling DoCommand(\"goto\") without a target; keybinding mapped to 'Goto' without supplying count/args (e.g. pressing Ctrl-g style binding that calls GotoCmd directly with empty args).","commonSituations":"New users expecting bare 'goto' to open a line prompt like other editors; plugins invoking the goto action programmatically without arguments; fat-fingered macros.","solutions":["Supply the target: > goto 42, > goto 42:7, or column-only > goto :7 (1-based; both values are clamped to the buffer)","In Lua, pass the argument through: DoCommand(\"goto 10\")","If you wanted an interactive prompt, bind and use the built-in that asks for input instead of relying on bare goto"],"exampleFix":"// before\n> goto\n# Not enough arguments\n\n// after\n> goto 120:5","handlingStrategy":"validation","validationCode":"// Require an argument before invoking Goto/Jump behavior\nfunc safeGoto(h *BufPane, args []string) {\n    if len(args) == 0 {\n        InfoBar.Error(\"usage: goto line[:col]  (e.g. 42 or 42:7)\")\n        return\n    }\n    h.GotoCmd(args)\n}","typeGuard":null,"tryCatchPattern":"// parseLineCol returns the error; GotoCmd/JumpCmd already report it via InfoBar.\n// Callers that reuse parseLineCol directly:\nline, col, err := h.parseLineCol(args)\nif err != nil {\n    if err.Error() == \"Not enough arguments\" {\n        InfoBar.Error(\"usage: goto line[:col]\")\n        return\n    }\n    InfoBar.Error(err) // Atoi failures like 'goto abc' arrive here\n    return\n}","preventionTips":["Teach users the line:col form once — 42:7 lands at line 42, column 7","In plugins, always append the target: DoCommand(\"goto \" .. line)","Both values are clamped, so out-of-range numbers are safe; only empty/bad text errors"],"tags":["command","arguments","validation","navigation","editor-command"],"backgroundTag":null,"analyzedSha":"1c8b82b32e408a5faf340039ed92d5266bea3293","analyzedAt":"2026-08-15T20:01:45.134Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}