From d779ff7e6dcf068fbcf743bed45127c3b857ec92 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 3 Jan 2021 00:00:40 +0900 Subject: Make search toggleable - `--phony` renamed to `--disabled` for consistency - `--no-phony` is now `--enabled` - Added `enable-search`, `disable-search`, and `toggle-search` actions for `--bind` - Added `--color` options: `query` and `disabled` Close #2303 --- src/tui/tui.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/tui') diff --git a/src/tui/tui.go b/src/tui/tui.go index cc9c7f67..eb09da40 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -250,6 +250,7 @@ func (p ColorPair) MergeNonDefault(other ColorPair) ColorPair { type ColorTheme struct { Colored bool Input ColorAttr + Disabled ColorAttr Fg ColorAttr Bg ColorAttr PreviewFg ColorAttr @@ -421,6 +422,7 @@ var ( ColPrompt ColorPair ColNormal ColorPair ColInput ColorPair + ColDisabled ColorPair ColMatch ColorPair ColCursor ColorPair ColCursorEmpty ColorPair @@ -443,6 +445,7 @@ func EmptyTheme() *ColorTheme { return &ColorTheme{ Colored: true, Input: ColorAttr{colUndefined, AttrUndefined}, + Disabled: ColorAttr{colUndefined, AttrUndefined}, Fg: ColorAttr{colUndefined, AttrUndefined}, Bg: ColorAttr{colUndefined, AttrUndefined}, PreviewFg: ColorAttr{colUndefined, AttrUndefined}, @@ -465,6 +468,7 @@ func NoColorTheme() *ColorTheme { return &ColorTheme{ Colored: false, Input: ColorAttr{colDefault, AttrRegular}, + Disabled: ColorAttr{colDefault, AttrRegular}, Fg: ColorAttr{colDefault, AttrRegular}, Bg: ColorAttr{colDefault, AttrRegular}, PreviewFg: ColorAttr{colDefault, AttrRegular}, @@ -492,6 +496,7 @@ func init() { Default16 = &ColorTheme{ Colored: true, Input: ColorAttr{colDefault, AttrUndefined}, + Disabled: ColorAttr{colUndefined, AttrUndefined}, Fg: ColorAttr{colDefault, AttrUndefined}, Bg: ColorAttr{colDefault, AttrUndefined}, PreviewFg: ColorAttr{colUndefined, AttrUndefined}, @@ -511,6 +516,7 @@ func init() { Dark256 = &ColorTheme{ Colored: true, Input: ColorAttr{colDefault, AttrUndefined}, + Disabled: ColorAttr{colUndefined, AttrUndefined}, Fg: ColorAttr{colDefault, AttrUndefined}, Bg: ColorAttr{colDefault, AttrUndefined}, PreviewFg: ColorAttr{colUndefined, AttrUndefined}, @@ -530,6 +536,7 @@ func init() { Light256 = &ColorTheme{ Colored: true, Input: ColorAttr{colDefault, AttrUndefined}, + Disabled: ColorAttr{colUndefined, AttrUndefined}, Fg: ColorAttr{colDefault, AttrUndefined}, Bg: ColorAttr{colDefault, AttrUndefined}, PreviewFg: ColorAttr{colUndefined, AttrUndefined}, @@ -564,6 +571,7 @@ func initTheme(theme *ColorTheme, baseTheme *ColorTheme, forceBlack bool) { return c } theme.Input = o(baseTheme.Input, theme.Input) + theme.Disabled = o(theme.Input, o(baseTheme.Disabled, theme.Disabled)) theme.Fg = o(baseTheme.Fg, theme.Fg) theme.Bg = o(baseTheme.Bg, theme.Bg) theme.PreviewFg = o(theme.Fg, o(baseTheme.PreviewFg, theme.PreviewFg)) @@ -597,6 +605,7 @@ func initPalette(theme *ColorTheme) { ColPrompt = pair(theme.Prompt, theme.Bg) ColNormal = pair(theme.Fg, theme.Bg) ColInput = pair(theme.Input, theme.Bg) + ColDisabled = pair(theme.Disabled, theme.Bg) ColMatch = pair(theme.Match, theme.Bg) ColCursor = pair(theme.Cursor, theme.Gutter) ColCursorEmpty = pair(blank, theme.Gutter) -- cgit v1.2.3