diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 index 9fa19f48..25fbcc18 100644 --- a/man/man1/fzf.1 +++ b/man/man1/fzf.1 @@ -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) diff --git a/src/options.go b/src/options.go index 9042b6d7..cb077a17 100644 --- a/src/options.go +++ b/src/options.go @@ -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() } diff --git a/src/terminal.go b/src/terminal.go index 2889bf01..a5d8f767 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -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 { diff --git a/src/tui/tui.go b/src/tui/tui.go index 921c7a04..212a1bed 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -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)