mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-02-02 03:58:30 +00:00
Add 'gap-line' color for the horizontal line on each gap
Color inheritance: border >> list-border >> gap-line
This commit is contained in:
parent
0a10d14e19
commit
c1875af70b
@ -228,6 +228,7 @@ color mappings.
|
||||
\fBlist\-border \fRBorder around the list section (\fB\-\-list\-border\fR)
|
||||
\fBscrollbar \fRScrollbar
|
||||
\fBseparator \fRHorizontal separator on info line
|
||||
\fBgap\-line \fRHorizontal line on each gap
|
||||
\fBpreview\-border \fRBorder around the preview window (\fB\-\-preview\fR)
|
||||
\fBpreview\-scrollbar \fRScrollbar
|
||||
\fBinput\-border \fRBorder around the input window (\fB\-\-input\-border\fR)
|
||||
|
@ -1262,6 +1262,8 @@ func parseTheme(defaultTheme *tui.ColorTheme, str string) (*tui.ColorTheme, erro
|
||||
mergeAttr(&theme.Header)
|
||||
case "header-bg":
|
||||
mergeAttr(&theme.HeaderBg)
|
||||
case "gap-line":
|
||||
mergeAttr(&theme.GapLine)
|
||||
default:
|
||||
fail()
|
||||
}
|
||||
|
@ -957,7 +957,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
|
||||
|
||||
// Gap line
|
||||
if t.gap > 0 && len(*opts.GapLine) > 0 {
|
||||
t.gapLine, t.gapLineLen = t.ansiLabelPrinter(*opts.GapLine, &tui.ColListBorder, true)
|
||||
t.gapLine, t.gapLineLen = t.ansiLabelPrinter(*opts.GapLine, &tui.ColGapLine, true)
|
||||
}
|
||||
|
||||
if opts.Ellipsis != nil {
|
||||
|
@ -341,6 +341,7 @@ type ColorTheme struct {
|
||||
BorderLabel ColorAttr
|
||||
ListLabel ColorAttr
|
||||
ListBorder ColorAttr
|
||||
GapLine ColorAttr
|
||||
}
|
||||
|
||||
type Event struct {
|
||||
@ -655,6 +656,7 @@ var (
|
||||
ColHeaderLabel ColorPair
|
||||
ColSeparator ColorPair
|
||||
ColScrollbar ColorPair
|
||||
ColGapLine ColorPair
|
||||
ColBorder ColorPair
|
||||
ColPreview ColorPair
|
||||
ColPreviewBorder ColorPair
|
||||
@ -708,6 +710,7 @@ func EmptyTheme() *ColorTheme {
|
||||
HeaderBg: ColorAttr{colUndefined, AttrUndefined},
|
||||
HeaderBorder: ColorAttr{colUndefined, AttrUndefined},
|
||||
HeaderLabel: ColorAttr{colUndefined, AttrUndefined},
|
||||
GapLine: ColorAttr{colUndefined, AttrUndefined},
|
||||
Nth: ColorAttr{colUndefined, AttrUndefined},
|
||||
}
|
||||
}
|
||||
@ -752,6 +755,7 @@ func NoColorTheme() *ColorTheme {
|
||||
HeaderBg: ColorAttr{colDefault, AttrUndefined},
|
||||
HeaderBorder: ColorAttr{colDefault, AttrUndefined},
|
||||
HeaderLabel: ColorAttr{colDefault, AttrUndefined},
|
||||
GapLine: ColorAttr{colDefault, AttrUndefined},
|
||||
Nth: ColorAttr{colUndefined, AttrUndefined},
|
||||
}
|
||||
}
|
||||
@ -793,6 +797,7 @@ func init() {
|
||||
InputBg: ColorAttr{colUndefined, AttrUndefined},
|
||||
InputBorder: ColorAttr{colUndefined, AttrUndefined},
|
||||
InputLabel: ColorAttr{colUndefined, AttrUndefined},
|
||||
GapLine: ColorAttr{colUndefined, AttrUndefined},
|
||||
Nth: ColorAttr{colUndefined, AttrUndefined},
|
||||
}
|
||||
Dark256 = &ColorTheme{
|
||||
@ -831,6 +836,7 @@ func init() {
|
||||
InputBg: ColorAttr{colUndefined, AttrUndefined},
|
||||
InputBorder: ColorAttr{colUndefined, AttrUndefined},
|
||||
InputLabel: ColorAttr{colUndefined, AttrUndefined},
|
||||
GapLine: ColorAttr{colUndefined, AttrUndefined},
|
||||
Nth: ColorAttr{colUndefined, AttrUndefined},
|
||||
}
|
||||
Light256 = &ColorTheme{
|
||||
@ -872,6 +878,7 @@ func init() {
|
||||
HeaderBg: ColorAttr{colUndefined, AttrUndefined},
|
||||
HeaderBorder: ColorAttr{colUndefined, AttrUndefined},
|
||||
HeaderLabel: ColorAttr{colUndefined, AttrUndefined},
|
||||
GapLine: ColorAttr{colUndefined, AttrUndefined},
|
||||
Nth: ColorAttr{colUndefined, AttrUndefined},
|
||||
}
|
||||
}
|
||||
@ -927,6 +934,7 @@ func InitTheme(theme *ColorTheme, baseTheme *ColorTheme, forceBlack bool, hasInp
|
||||
theme.ListBorder = o(theme.Border, theme.ListBorder)
|
||||
theme.Separator = o(theme.ListBorder, theme.Separator)
|
||||
theme.Scrollbar = o(theme.ListBorder, theme.Scrollbar)
|
||||
theme.GapLine = o(theme.ListBorder, theme.GapLine)
|
||||
/*
|
||||
--color list-border:green
|
||||
--color scrollbar:red
|
||||
@ -992,6 +1000,7 @@ func initPalette(theme *ColorTheme) {
|
||||
ColInfo = pair(theme.Info, theme.InputBg)
|
||||
ColSeparator = pair(theme.Separator, theme.InputBg)
|
||||
ColScrollbar = pair(theme.Scrollbar, theme.ListBg)
|
||||
ColGapLine = pair(theme.GapLine, theme.ListBg)
|
||||
ColBorder = pair(theme.Border, theme.Bg)
|
||||
ColBorderLabel = pair(theme.BorderLabel, theme.Bg)
|
||||
ColPreviewLabel = pair(theme.PreviewLabel, theme.PreviewBg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user