summaryrefslogtreecommitdiff
path: root/src/tui
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2021-01-03 00:00:40 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2021-01-03 00:15:00 +0900
commitd779ff7e6dcf068fbcf743bed45127c3b857ec92 (patch)
treee50d90a35c8a59841eaad89af9c5718ab2663237 /src/tui
parentfd8858f8c93e38d50f00cd21430e21d89e2f9399 (diff)
downloadfzf-d779ff7e6dcf068fbcf743bed45127c3b857ec92.tar.gz
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
Diffstat (limited to 'src/tui')
-rw-r--r--src/tui/tui.go9
1 files changed, 9 insertions, 0 deletions
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)