Allow customizing --ghost color via '--color ghost'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Examples: # Dimmed red fzf --ghost booya --color ghost:red # Regular red fzf --ghost booya --color ghost:red:regular Close #4398
authored by Junegunn Choi · committed by Junegunn Choi · parent a4c6846 · Browse files · 4 files·+13 added−1 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+13 added−1 removed
- other:+13 added−1 removed
Provenance
- Commit
ffb6e28- Tree
ce9f981- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
a4c6846
4 files changed+13 added−1 removed
modified:man/man1/fzf.1+1 added
270 unmodified lines271 \fBgutter \fRGutter on the left272 \fBcurrent\-hl (hl+) \fRHighlighted substrings (current line)273 \fBalt\-bg \fRAlternate background color to create striped lines274 \fBquery (input\-fg) \fRQuery string275+ \fBghost \fRGhost text (\fB\-\-ghost\fR, \fBdim\fR applied by default)276 \fBdisabled \fRQuery string when search is disabled (\fB\-\-disabled\fR)277 \fBinfo \fRInfo line (match counters)278 \fBborder \fRBorder around the window (\fB\-\-border\fR and \fB\-\-preview\fR)279 \fBlist\-border \fRBorder around the list section (\fB\-\-list\-border\fR)1672 unmodified linesmodified:src/tui/tui.go+9 added
327 unmodified lines328 329 type ColorTheme struct {330 Colored bool331 Input ColorAttr332+ Ghost ColorAttr333 Disabled ColorAttr334 Fg ColorAttr335 Bg ColorAttr336 ListFg ColorAttr364 unmodified lines701 ColPrompt ColorPair702 ColNormal ColorPair703 ColInput ColorPair704 ColDisabled ColorPair705+ ColGhost ColorPair706 ColMatch ColorPair707 ColCursor ColorPair708 ColCursorEmpty ColorPair709 ColMarker ColorPair51 unmodified lines761 Border: ColorAttr{colUndefined, AttrUndefined},762 BorderLabel: ColorAttr{colUndefined, AttrUndefined},763 ListLabel: ColorAttr{colUndefined, AttrUndefined},764 ListBorder: ColorAttr{colUndefined, AttrUndefined},765+ Ghost: ColorAttr{colUndefined, Dim},766 Disabled: ColorAttr{colUndefined, AttrUndefined},767 PreviewFg: ColorAttr{colUndefined, AttrUndefined},768 PreviewBg: ColorAttr{colUndefined, AttrUndefined},769 Gutter: ColorAttr{colUndefined, AttrUndefined},36 unmodified lines806 Marker: ColorAttr{colDefault, AttrUndefined},807 Header: ColorAttr{colDefault, AttrUndefined},808 Border: ColorAttr{colDefault, AttrUndefined},809 BorderLabel: ColorAttr{colDefault, AttrUndefined},810+ Ghost: ColorAttr{colDefault, Dim},811 Disabled: ColorAttr{colDefault, AttrUndefined},812 PreviewFg: ColorAttr{colDefault, AttrUndefined},813 PreviewBg: ColorAttr{colDefault, AttrUndefined},814 Gutter: ColorAttr{colDefault, AttrUndefined},38 unmodified lines853 Marker: ColorAttr{colMagenta, AttrUndefined},854 Header: ColorAttr{colCyan, AttrUndefined},855 Border: ColorAttr{colBlack, AttrUndefined},856 BorderLabel: ColorAttr{colWhite, AttrUndefined},857+ Ghost: ColorAttr{colUndefined, Dim},858 Disabled: ColorAttr{colUndefined, AttrUndefined},859 PreviewFg: ColorAttr{colUndefined, AttrUndefined},860 PreviewBg: ColorAttr{colUndefined, AttrUndefined},861 Gutter: ColorAttr{colUndefined, AttrUndefined},32 unmodified lines894 Marker: ColorAttr{168, AttrUndefined},895 Header: ColorAttr{109, AttrUndefined},896 Border: ColorAttr{59, AttrUndefined},897 BorderLabel: ColorAttr{145, AttrUndefined},898+ Ghost: ColorAttr{colUndefined, Dim},899 Disabled: ColorAttr{colUndefined, AttrUndefined},900 PreviewFg: ColorAttr{colUndefined, AttrUndefined},901 PreviewBg: ColorAttr{colUndefined, AttrUndefined},902 Gutter: ColorAttr{colUndefined, AttrUndefined},32 unmodified lines935 Marker: ColorAttr{168, AttrUndefined},936 Header: ColorAttr{31, AttrUndefined},937 Border: ColorAttr{145, AttrUndefined},938 BorderLabel: ColorAttr{59, AttrUndefined},939+ Ghost: ColorAttr{colUndefined, Dim},940 Disabled: ColorAttr{colUndefined, AttrUndefined},941 PreviewFg: ColorAttr{colUndefined, AttrUndefined},942 PreviewBg: ColorAttr{colUndefined, AttrUndefined},943 Gutter: ColorAttr{colUndefined, AttrUndefined},57 unmodified lines1001 theme.ListBg = o(theme.Bg, theme.ListBg)1002 theme.SelectedFg = o(theme.ListFg, theme.SelectedFg)1003 theme.SelectedBg = o(theme.ListBg, theme.SelectedBg)1004 theme.SelectedMatch = o(theme.Match, theme.SelectedMatch)1005+ theme.Ghost = o(theme.Input, theme.Ghost)1006 theme.Disabled = o(theme.Input, theme.Disabled)1007 theme.Gutter = o(theme.DarkBg, theme.Gutter)1008 theme.PreviewFg = o(theme.Fg, theme.PreviewFg)1009 theme.PreviewBg = o(theme.Bg, theme.PreviewBg)48 unmodified lines1058 ColPrompt = pair(theme.Prompt, theme.InputBg)1059 ColNormal = pair(theme.ListFg, theme.ListBg)1060 ColSelected = pair(theme.SelectedFg, theme.SelectedBg)1061 ColInput = pair(theme.Input, theme.InputBg)1062+ ColGhost = pair(theme.Ghost, theme.InputBg)1063 ColDisabled = pair(theme.Disabled, theme.InputBg)1064 ColMatch = pair(theme.Match, theme.ListBg)1065 ColSelectedMatch = pair(theme.SelectedMatch, theme.SelectedBg)1066 ColCursor = pair(theme.Cursor, theme.Gutter)36 unmodified linesmodified:src/options.go+2 added
1280 unmodified lines1281 }1282 switch components[0] {1283 case "query", "input", "input-fg":1284 mergeAttr(&theme.Input)1285+ case "ghost":1286+ mergeAttr(&theme.Ghost)1287 case "disabled":1288 mergeAttr(&theme.Disabled)1289 case "fg":1290 mergeAttr(&theme.Fg)2219 unmodified linesmodified:src/terminal.go+1 added-1 removed
2384 unmodified lines2385 t.prompt()2386 2387 before, after := t.updatePromptOffset()2388 if len(before) == 0 && len(after) == 0 && len(t.ghost) > 0 {2389- w.CPrint(tui.ColInput.WithAttr(tui.Dim), t.ghost)2389+ w.CPrint(tui.ColGhost, t.ghost)2390 return2391 }2392 2393 color := tui.ColInput4003 unmodified lines