{"record":{"id":"dcae4f0e103e7d6b","repo":"junegunn/fzf","slug":"invalid-scoring-scheme-str-expected-default","errorCode":null,"errorMessage":"invalid scoring scheme: ${str} (expected: default|path|history)","messagePattern":"invalid scoring scheme: (.+?) \\(expected: default\\|path\\|history\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":1346,"sourceCode":"\t}\n\tms := math.Round(secs * 1000)\n\tif ms > math.MaxInt32 {\n\t\treturn tui.Event{}, errors.New(\"every() interval is too large\")\n\t}\n\treturn tui.Event{Type: tui.Every, Char: rune(int32(ms))}, nil\n}\n\nfunc parseScheme(str string) (string, []criterion, error) {\n\tstr = strings.ToLower(str)\n\tswitch str {\n\tcase \"history\":\n\t\treturn str, []criterion{byScore}, nil\n\tcase \"path\":\n\t\treturn str, []criterion{byScore, byPathname, byLength}, nil\n\tcase \"default\":\n\t\treturn str, []criterion{byScore, byLength}, nil\n\t}\n\treturn str, nil, errors.New(\"invalid scoring scheme: \" + str + \" (expected: default|path|history)\")\n}\n\nfunc parseTiebreak(str string) ([]criterion, error) {\n\tcriteria := []criterion{byScore}\n\thasIndex := false\n\thasChunk := false\n\thasLength := false\n\thasBegin := false\n\thasEnd := false\n\thasPathname := false\n\tcheck := func(notExpected *bool, name string) error {\n\t\tif *notExpected {\n\t\t\treturn errors.New(\"duplicate sort criteria: \" + name)\n\t\t}\n\t\tif hasIndex {\n\t\t\treturn errors.New(\"index should be the last criterion\")\n\t\t}\n\t\t*notExpected = true","sourceCodeStart":1328,"sourceCodeEnd":1364,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L1328-L1364","documentation":"parseScheme maps the --scheme flag (fzf 0.48+, deprecating --algo-specific ranking) to a ranking strategy: 'history' ranks by score alone, 'path' adds pathname/length awareness, 'default' is score+length. Any other lowercase token is rejected with the accepted list.","triggerScenarios":"--scheme fuzzy, --scheme=path (not in the list), --scheme History (lowercased before the switch, so this actually works — but '--scheme default2' fails), or an unset variable producing '--scheme ' with an empty value.","commonSituations":"Dotfiles from skim or other clones using scheme names like 'path_history'; users assuming --scheme mirrors --algo values; empty expansion of $FZF_SCHEME in exported FZF_DEFAULT_OPTS.","solutions":["Use one of default|path|history: fzf --scheme path","Omit --scheme to get 'default' behavior","Default unset shell variables: --scheme \"${SCHEME:-default}\"","For historical ranking via $FZF_HISTORY_FILE just use --scheme history"],"exampleFix":"# before\nfzf --scheme=fuzzy\n# after\nfzf --scheme=default","handlingStrategy":"type-guard","validationCode":"SCHEME=\"${SCHEME:-default}\"\ncase \"${SCHEME,,}\" in default|path|history) ;; *) echo \"invalid scheme: $SCHEME\" >&2; exit 1;; esac\nfzf --scheme \"$SCHEME\"","typeGuard":"isValidFzfScheme() { case \"$1\" in default|path|history) return 0;; *) return 1;; esac; }","tryCatchPattern":null,"preventionTips":["Whitelist --scheme values in wrapper scripts","Omit the flag for default behavior","Do not mix --scheme vocabulary with --algo vocabulary"],"tags":["fzf","options-parsing","ranking","configuration","go"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}