{"record":{"id":"27fe6cb95ac21e50","repo":"junegunn/fzf","slug":"invalid-total-marker-width-d-expected-0-3-or","errorCode":null,"errorMessage":"invalid total marker width: %d (expected: 0, 3 or 6)","messagePattern":"invalid total marker width: (.+?) \\(expected: 0, 3 or 6\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/options.go","lineNumber":2503,"sourceCode":"\treturn [4]sizeSpec{}, errors.New(\"invalid \" + opt + \": \" + margin)\n}\n\nfunc parseMarkerMultiLine(str string) (*[3]string, error) {\n\tif str == \"\" {\n\t\treturn &[3]string{}, nil\n\t}\n\tgr := uniseg.NewGraphemes(str)\n\tparts := []string{}\n\ttotalWidth := 0\n\tfor gr.Next() {\n\t\ts := string(gr.Runes())\n\t\ttotalWidth += uniseg.StringWidth(s)\n\t\tparts = append(parts, s)\n\t}\n\n\tresult := [3]string{}\n\tif totalWidth != 3 && totalWidth != 6 {\n\t\treturn &result, fmt.Errorf(\"invalid total marker width: %d (expected: 0, 3 or 6)\", totalWidth)\n\t}\n\n\texpected := totalWidth / 3\n\tidx := 0\n\tfor _, part := range parts {\n\t\texpected -= uniseg.StringWidth(part)\n\t\tresult[idx] += part\n\t\tif expected <= 0 {\n\t\t\tidx++\n\t\t\texpected = totalWidth / 3\n\t\t}\n\t\tif idx == 3 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn &result, nil\n}\n","sourceCodeStart":2485,"sourceCodeEnd":2521,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L2485-L2521","documentation":"The multi-line marker string (parsed by parseMarkerMultiLine, used by marker options that need three equal-width segments) must have a total display width of exactly 3 (one cell per marker) or 6 (two cells each, e.g. emoji-wide graphemes). Any other total width is rejected. Width is measured per grapheme cluster, so combining characters and emoji count by their rendered width.","triggerScenarios":"Passing a marker option (e.g. --marker) whose combined grapheme clusters total 0-as-nonempty, 1, 2, 4, 5, or more than 6 display columns; e.g. a single '> ' (width 2), four ASCII characters, or three double-width emoji plus one ASCII char.","commonSituations":"Customizing --marker with an emoji ('👉' is width 2, so three of them = 6 and works, but two of them = 4 fails); mixing a wide emoji with ASCII markers; older snippets assuming byte- or rune-based limits.","solutions":["Use exactly three single-width characters: --marker='>>>' (width 3)","Or exactly three double-width graphemes (e.g. three emoji) for width 6","Check widths programmatically if generating markers: each third must render to the same column count"],"exampleFix":"# before\nfzf --marker='👉👉'   # width 4\n# after\nfzf --marker='>>>'    # width 3\n# or\nfzf --marker='👉👉👉'  # width 6","handlingStrategy":"validation","validationCode":"# Go helper: accept only width-3 or width-6 markers before building args\nfunc markerOK(s string) bool {\n    w := uniseg.StringWidth(s)\n    return s == \"\" || w == 3 || w == 6\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Count display columns, not bytes or runes — emoji count as 2","Use three identical ASCII characters as the safe default marker"],"tags":["fzf","options","marker","unicode","width"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}