mirror of
https://github.com/junegunn/fzf.git
synced 2026-02-07 10:21:13 +08:00
Apply alt-bg on items with even indexes
This commit is contained in:
@@ -2795,12 +2795,14 @@ func (t *Terminal) printItem(result Result, line int, maxLine int, index int, cu
|
||||
altBg := t.theme.AltBg
|
||||
selectedBg := selected && t.theme.SelectedBg != t.theme.ListBg
|
||||
if t.jumping != jumpDisabled {
|
||||
if !altBg.IsColorDefined() {
|
||||
altBg = t.theme.DarkBg
|
||||
}
|
||||
if index < len(t.jumpLabels) {
|
||||
// Striped
|
||||
alt = index%2 == 0
|
||||
if !altBg.IsColorDefined() {
|
||||
altBg = t.theme.DarkBg
|
||||
alt = index%2 == 0
|
||||
} else {
|
||||
alt = index%2 == 1
|
||||
}
|
||||
label = t.jumpLabels[index:index+1] + strings.Repeat(" ", util.Max(0, t.pointerLen-1))
|
||||
if t.pointerLen == 0 {
|
||||
extraWidth = 1
|
||||
@@ -2810,7 +2812,7 @@ func (t *Terminal) printItem(result Result, line int, maxLine int, index int, cu
|
||||
if current {
|
||||
label = t.pointer
|
||||
}
|
||||
alt = !selectedBg && altBg.IsColorDefined() && index%2 == 0
|
||||
alt = !selectedBg && altBg.IsColorDefined() && index%2 == 1
|
||||
}
|
||||
|
||||
// Avoid unnecessary redraw
|
||||
|
||||
Reference in New Issue
Block a user