diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-02-06 19:56:40 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-02-06 19:57:39 +0900 |
| commit | 62e0a2824a9ed2783fee54f53dd258a2bc3ed795 (patch) | |
| tree | 83c14a09b9f24ec138835ac9536c0aada10e4505 /src/core.go | |
| parent | bbe1721a1883426f639c1efe6afef1d3e6c25181 (diff) | |
| download | fzf-62e0a2824a9ed2783fee54f53dd258a2bc3ed795.tar.gz | |
Fix nth highlighting
Fix #4222
Diffstat (limited to 'src/core.go')
| -rw-r--r-- | src/core.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core.go b/src/core.go index 71cf04da..cad139dd 100644 --- a/src/core.go +++ b/src/core.go @@ -195,15 +195,14 @@ func Run(opts *Options) (int, error) { } nth := opts.Nth - nthRevision := 0 + inputRevision := revision{} + snapshotRevision := revision{} patternCache := make(map[string]*Pattern) patternBuilder := func(runes []rune) *Pattern { return BuildPattern(cache, patternCache, opts.Fuzzy, opts.FuzzyAlgo, opts.Extended, opts.Case, opts.Normalize, forward, withPos, - opts.Filter == nil, nth, opts.Delimiter, nthRevision, runes) + opts.Filter == nil, nth, opts.Delimiter, inputRevision, runes) } - inputRevision := revision{} - snapshotRevision := revision{} matcher := NewMatcher(cache, patternBuilder, sort, opts.Tac, eventBox, inputRevision) // Filtering mode @@ -382,7 +381,6 @@ func Run(opts *Options) (int, error) { if val.nth != nil { // Change nth and clear caches nth = *val.nth - nthRevision++ patternCache = make(map[string]*Pattern) cache.Clear() inputRevision.bumpMinor() |
