m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Revise color configuration

This commit is contained in:
Junegunn Choi
2025-10-01 00:00:54 +09:00
parent ce2200e908
commit e6ad01fb90
7 changed files with 372 additions and 292 deletions

View File

@@ -1109,14 +1109,18 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
t.acceptNth = opts.AcceptNth(t.delimiter)
}
baseTheme := opts.BaseTheme
if baseTheme == nil {
baseTheme = renderer.DefaultTheme()
}
// This should be called before accessing tui.Color*
tui.InitTheme(opts.Theme, renderer.DefaultTheme(), opts.Black, opts.InputBorderShape.Visible(), opts.HeaderBorderShape.Visible())
tui.InitTheme(opts.Theme, baseTheme, opts.Bold, opts.Black, opts.InputBorderShape.Visible(), opts.HeaderBorderShape.Visible())
// Gutter character
var gutterChar, gutterRawChar string
if opts.Gutter != nil {
gutterChar = *opts.Gutter
} else if t.unicode && !t.theme.Gutter.Color.IsDefault() {
} else if t.unicode {
gutterChar = "▌"
} else {
gutterChar = " "
@@ -1125,7 +1129,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
if opts.GutterRaw != nil {
gutterRawChar = *opts.GutterRaw
} else if t.unicode && !t.theme.Gutter.Color.IsDefault() {
} else if t.unicode {
gutterRawChar = "▖"
} else {
gutterRawChar = ":"