diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-06-24 22:50:02 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-06-25 02:12:10 +0900 |
| commit | 4811e52af3ed7f89e82baa908f9a8a25fb593361 (patch) | |
| tree | da7d88eadf9a0e8044b4748dd790cd599117b663 /src/core.go | |
| parent | 8d81730ec2855d3d32a171f8b675430ffb4c4d59 (diff) | |
| download | fzf-4811e52af3ed7f89e82baa908f9a8a25fb593361.tar.gz | |
Support full-line background color in the list section
Close #4432
Diffstat (limited to 'src/core.go')
| -rw-r--r-- | src/core.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core.go b/src/core.go index 7a762e3c..2fca98fb 100644 --- a/src/core.go +++ b/src/core.go @@ -6,6 +6,7 @@ import ( "sync" "time" + "github.com/junegunn/fzf/src/tui" "github.com/junegunn/fzf/src/util" ) @@ -78,6 +79,16 @@ func Run(opts *Options) (int, error) { prevLineAnsiState = lineAnsiState trimmed, offsets, newState := extractColor(byteString(data), lineAnsiState, nil) lineAnsiState = newState + + // Full line background is found. Add a special marker. + if !opts.ReadZero && offsets != nil && newState != nil && len(*offsets) > 0 && newState.lbg >= 0 { + marker := (*offsets)[len(*offsets)-1] + marker.offset[0] = marker.offset[1] + marker.color.bg = newState.lbg + marker.color.attr = marker.color.attr | tui.FullBg + newOffsets := append(*offsets, marker) + offsets = &newOffsets + } return util.ToChars(stringBytes(trimmed)), offsets } } |
