@@ -16,6 +16,7 @@ type colorOffset struct {
16
16
offset [2 ]int32
17
17
color tui.ColorPair
18
18
match bool
19
+ url * url
19
20
}
20
21
21
22
type Result struct {
@@ -177,8 +178,11 @@ func (result *Result) colorOffsets(matchOffsets []Offset, theme *tui.ColorTheme,
177
178
if curr != 0 && idx > start {
178
179
if curr < 0 {
179
180
color := colMatch
181
+ var url * url
180
182
if curr < - 1 && theme .Colored {
181
- origColor := ansiToColorPair (itemColors [- curr - 2 ], colMatch )
183
+ ansi := itemColors [- curr - 2 ]
184
+ url = ansi .color .url
185
+ origColor := ansiToColorPair (ansi , colMatch )
182
186
// hl or hl+ only sets the foreground color, so colMatch is the
183
187
// combination of either [hl and bg] or [hl+ and bg+].
184
188
//
@@ -194,13 +198,14 @@ func (result *Result) colorOffsets(matchOffsets []Offset, theme *tui.ColorTheme,
194
198
}
195
199
}
196
200
colors = append (colors , colorOffset {
197
- offset : [2 ]int32 {int32 (start ), int32 (idx )}, color : color , match : true })
201
+ offset : [2 ]int32 {int32 (start ), int32 (idx )}, color : color , match : true , url : url })
198
202
} else {
199
203
ansi := itemColors [curr - 1 ]
200
204
colors = append (colors , colorOffset {
201
205
offset : [2 ]int32 {int32 (start ), int32 (idx )},
202
206
color : ansiToColorPair (ansi , colBase ),
203
- match : false })
207
+ match : false ,
208
+ url : ansi .color .url })
204
209
}
205
210
}
206
211
}
0 commit comments