Skip to content

Commit

Permalink
Improved inverted theme for ligth terminals, added a simple monochrom…
Browse files Browse the repository at this point in the history
…e theme which just uses defaults, works great in most cases
  • Loading branch information
Hultner authored and chriswalz committed Oct 29, 2020
1 parent ff050ce commit 640a6b1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,27 @@ var DefaultTheme = PromptTheme{
}

var InvertedTheme = PromptTheme{
PrefixTextColor: prompt.Blue, // fine
SelectedSuggestionBGColor: prompt.Blue,
PrefixTextColor: prompt.Blue,
SelectedSuggestionBGColor: prompt.LightGray,
SelectedSuggestionTextColor: prompt.White,
SuggestionBGColor: prompt.Blue,
SuggestionTextColor: prompt.LightGray,
SelectedSuggestionTextColor: prompt.Yellow,
DescriptionBGColor: prompt.White,
SuggestionTextColor: prompt.White,
DescriptionBGColor: prompt.LightGray,
DescriptionTextColor: prompt.Black,
}

var MonochromeTheme= PromptTheme{
}

func SuggestionPrompt(prefix string, completer func(d prompt.Document) []prompt.Suggest) string {
theme := DefaultTheme
themeName := os.Getenv("BIT_THEME")
if strings.EqualFold(themeName, "inverted") {
theme = InvertedTheme
}
if strings.EqualFold(themeName, "monochrome") {
theme = MonochromeTheme
}
result := prompt.Input(prefix, completer,
prompt.OptionTitle(""),
prompt.OptionHistory([]string{""}),
Expand Down Expand Up @@ -558,4 +564,4 @@ func asyncLoad(suggestionFunc func() []prompt.Suggest) func() []prompt.Suggest {
wg.Wait()
return suggestions
}
}
}

0 comments on commit 640a6b1

Please sign in to comment.