summaryrefslogtreecommitdiff
path: root/src/result.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-05-30 20:52:13 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-05-30 21:02:35 +0900
commit15d6c17390ba4d795989bcc65c0afaf91caaf41d (patch)
treed7e98b8bdbc337ff53bac2eabcd797b4f9a398a1 /src/result.go
parenta9d1d424364ecbdbdb204fc1ffb2463b44bf1e6c (diff)
downloadfzf-15d6c17390ba4d795989bcc65c0afaf91caaf41d.tar.gz
Fix ANSI attributes lost when nth:regular is set
Example: # foo was not displayed in italic echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color fg:dim,nth:regular --nth 1
Diffstat (limited to 'src/result.go')
-rw-r--r--src/result.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/result.go b/src/result.go
index acd7bb06..3c63e2e4 100644
--- a/src/result.go
+++ b/src/result.go
@@ -228,10 +228,11 @@ func (result *Result) colorOffsets(matchOffsets []Offset, nthOffsets []Offset, t
offset: [2]int32{int32(start), int32(idx)}, color: color, match: true, url: url})
} else if curr.color {
ansi := itemColors[curr.index]
- color := ansiToColorPair(ansi, colBase)
+ base := colBase
if curr.nth {
- color = color.WithAttr(attrNth)
+ base = base.WithAttr(attrNth)
}
+ color := ansiToColorPair(ansi, base)
colors = append(colors, colorOffset{
offset: [2]int32{int32(start), int32(idx)},
color: color,