{"record":{"id":"69ed9a29ed71d9d0","repo":"junegunn/fzf","slug":"s-too-large-max-d","errorCode":null,"errorMessage":"%s too large (max: %d%%)","messagePattern":"(.+?) too large \\(max: (.+?)%%\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/options.go","lineNumber":2239,"sourceCode":"func strLines(str string) []string {\n\treturn strings.Split(strings.TrimSuffix(str, \"\\n\"), \"\\n\")\n}\n\nfunc parseSize(str string, maxPercent float64, label string) (sizeSpec, error) {\n\tvar spec = sizeSpec{}\n\tvar val float64\n\tvar err error\n\tpercent := strings.HasSuffix(str, \"%\")\n\tif percent {\n\t\tif val, err = atof(str[:len(str)-1]); err != nil {\n\t\t\treturn spec, err\n\t\t}\n\n\t\tif val < 0 {\n\t\t\treturn spec, errors.New(label + \" must be non-negative\")\n\t\t}\n\t\tif val > maxPercent {\n\t\t\treturn spec, fmt.Errorf(\"%s too large (max: %d%%)\", label, int(maxPercent))\n\t\t}\n\t} else {\n\t\tif strings.Contains(str, \".\") {\n\t\t\treturn spec, errors.New(label + \" (without %) must be a non-negative integer\")\n\t\t}\n\n\t\ti, err := atoi(str)\n\t\tif err != nil {\n\t\t\treturn spec, err\n\t\t}\n\t\tval = float64(i)\n\t\tif val < 0 {\n\t\t\treturn spec, errors.New(label + \" must be non-negative\")\n\t\t}\n\t}\n\treturn sizeSpec{val, percent}, nil\n}\n","sourceCodeStart":2221,"sourceCodeEnd":2257,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L2221-L2257","documentation":"A size option given as a percentage exceeded the allowed maximum for that option. parseSize caps percent-form values (e.g. 100 for --height, smaller caps for other size options), and this error reports which label (height, preview size, margin, etc.) overshot and by what cap.","triggerScenarios":"Passing e.g. --height=150% (max 100), or a --preview-window size / margin value above its percent cap; any parseSize call where the numeric value before '%' is greater than the maxPercent argument.","commonSituations":"Scripts computing heights dynamically (N% based on terminal lines) and forgetting the percent-mode cap; copy-paste of a size meant for a different option; confusion between lines and percent forms.","solutions":["Lower the percentage to at or below the cap shown in the message (e.g. --height=100% is the max)","If you want more room, switch to the lines form which has no percent cap: --height=40 (or --height=~40% for auto)","Validate computed values before invoking fzf in your script"],"exampleFix":"# before\nfzf --height=150%\n# after\nfzf --height=100%\n# or use lines\nfzf --height=40","handlingStrategy":"validation","validationCode":"# clamp computed percentage before invoking fzf\npct=$(( lines * 100 / total ))\n[ \"$pct\" -gt 100 ] && pct=100\nfzf --height=\"${pct}%\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember each size option's percent cap (100 for height) when generating flags","Prefer the lines form when the value is computed dynamically"],"tags":["fzf","options","size","validation"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}