mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-15 17:57:07 +00:00
Respect 'regular' attribute in 'bw' base theme
Don't make the text bold if an element is explicitly specified as 'regular'. Fix #3222
This commit is contained in:
parent
d7daf5f724
commit
60f37aae2f
@ -2003,9 +2003,7 @@ func postProcessOptions(opts *Options) {
|
|||||||
theme := opts.Theme
|
theme := opts.Theme
|
||||||
boldify := func(c tui.ColorAttr) tui.ColorAttr {
|
boldify := func(c tui.ColorAttr) tui.ColorAttr {
|
||||||
dup := c
|
dup := c
|
||||||
if !theme.Colored {
|
if (c.Attr & tui.AttrRegular) == 0 {
|
||||||
dup.Attr |= tui.Bold
|
|
||||||
} else if (c.Attr & tui.AttrRegular) == 0 {
|
|
||||||
dup.Attr |= tui.Bold
|
dup.Attr |= tui.Bold
|
||||||
}
|
}
|
||||||
return dup
|
return dup
|
||||||
|
@ -201,7 +201,6 @@ type Terminal struct {
|
|||||||
tabstop int
|
tabstop int
|
||||||
margin [4]sizeSpec
|
margin [4]sizeSpec
|
||||||
padding [4]sizeSpec
|
padding [4]sizeSpec
|
||||||
strong tui.Attr
|
|
||||||
unicode bool
|
unicode bool
|
||||||
listenPort *int
|
listenPort *int
|
||||||
borderShape tui.BorderShape
|
borderShape tui.BorderShape
|
||||||
@ -541,10 +540,6 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
|
|||||||
if len(opts.Preview.command) > 0 || hasPreviewAction(opts) || opts.ListenPort != nil {
|
if len(opts.Preview.command) > 0 || hasPreviewAction(opts) || opts.ListenPort != nil {
|
||||||
previewBox = util.NewEventBox()
|
previewBox = util.NewEventBox()
|
||||||
}
|
}
|
||||||
strongAttr := tui.Bold
|
|
||||||
if !opts.Bold {
|
|
||||||
strongAttr = tui.AttrRegular
|
|
||||||
}
|
|
||||||
var renderer tui.Renderer
|
var renderer tui.Renderer
|
||||||
fullscreen := !opts.Height.auto && (opts.Height.size == 0 || opts.Height.percent && opts.Height.size == 100)
|
fullscreen := !opts.Height.auto && (opts.Height.size == 0 || opts.Height.percent && opts.Height.size == 100)
|
||||||
if fullscreen {
|
if fullscreen {
|
||||||
@ -623,7 +618,6 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
|
|||||||
previewLabelOpts: opts.PreviewLabel,
|
previewLabelOpts: opts.PreviewLabel,
|
||||||
cleanExit: opts.ClearOnExit,
|
cleanExit: opts.ClearOnExit,
|
||||||
paused: opts.Phony,
|
paused: opts.Phony,
|
||||||
strong: strongAttr,
|
|
||||||
cycle: opts.Cycle,
|
cycle: opts.Cycle,
|
||||||
headerFirst: opts.HeaderFirst,
|
headerFirst: opts.HeaderFirst,
|
||||||
headerLines: opts.HeaderLines,
|
headerLines: opts.HeaderLines,
|
||||||
|
@ -525,28 +525,28 @@ func EmptyTheme() *ColorTheme {
|
|||||||
func NoColorTheme() *ColorTheme {
|
func NoColorTheme() *ColorTheme {
|
||||||
return &ColorTheme{
|
return &ColorTheme{
|
||||||
Colored: false,
|
Colored: false,
|
||||||
Input: ColorAttr{colDefault, AttrRegular},
|
Input: ColorAttr{colDefault, AttrUndefined},
|
||||||
Fg: ColorAttr{colDefault, AttrRegular},
|
Fg: ColorAttr{colDefault, AttrUndefined},
|
||||||
Bg: ColorAttr{colDefault, AttrRegular},
|
Bg: ColorAttr{colDefault, AttrUndefined},
|
||||||
DarkBg: ColorAttr{colDefault, AttrRegular},
|
DarkBg: ColorAttr{colDefault, AttrUndefined},
|
||||||
Prompt: ColorAttr{colDefault, AttrRegular},
|
Prompt: ColorAttr{colDefault, AttrUndefined},
|
||||||
Match: ColorAttr{colDefault, Underline},
|
Match: ColorAttr{colDefault, Underline},
|
||||||
Current: ColorAttr{colDefault, Reverse},
|
Current: ColorAttr{colDefault, Reverse},
|
||||||
CurrentMatch: ColorAttr{colDefault, Reverse | Underline},
|
CurrentMatch: ColorAttr{colDefault, Reverse | Underline},
|
||||||
Spinner: ColorAttr{colDefault, AttrRegular},
|
Spinner: ColorAttr{colDefault, AttrUndefined},
|
||||||
Info: ColorAttr{colDefault, AttrRegular},
|
Info: ColorAttr{colDefault, AttrUndefined},
|
||||||
Cursor: ColorAttr{colDefault, AttrRegular},
|
Cursor: ColorAttr{colDefault, AttrUndefined},
|
||||||
Selected: ColorAttr{colDefault, AttrRegular},
|
Selected: ColorAttr{colDefault, AttrUndefined},
|
||||||
Header: ColorAttr{colDefault, AttrRegular},
|
Header: ColorAttr{colDefault, AttrUndefined},
|
||||||
Border: ColorAttr{colDefault, AttrRegular},
|
Border: ColorAttr{colDefault, AttrUndefined},
|
||||||
BorderLabel: ColorAttr{colDefault, AttrRegular},
|
BorderLabel: ColorAttr{colDefault, AttrUndefined},
|
||||||
Disabled: ColorAttr{colDefault, AttrRegular},
|
Disabled: ColorAttr{colDefault, AttrUndefined},
|
||||||
PreviewFg: ColorAttr{colDefault, AttrRegular},
|
PreviewFg: ColorAttr{colDefault, AttrUndefined},
|
||||||
PreviewBg: ColorAttr{colDefault, AttrRegular},
|
PreviewBg: ColorAttr{colDefault, AttrUndefined},
|
||||||
Gutter: ColorAttr{colDefault, AttrRegular},
|
Gutter: ColorAttr{colDefault, AttrUndefined},
|
||||||
PreviewLabel: ColorAttr{colDefault, AttrRegular},
|
PreviewLabel: ColorAttr{colDefault, AttrUndefined},
|
||||||
Separator: ColorAttr{colDefault, AttrRegular},
|
Separator: ColorAttr{colDefault, AttrUndefined},
|
||||||
Scrollbar: ColorAttr{colDefault, AttrRegular},
|
Scrollbar: ColorAttr{colDefault, AttrUndefined},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user