Skip to content

Commit

Permalink
Merge pull request #308 from patrik-bartak/color-flag-in-config
Browse files Browse the repository at this point in the history
Add color flag in config
  • Loading branch information
RamiAwar authored Jun 28, 2024
2 parents a50ff8c + 37d277d commit 2bcdff6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func filter(options []string, tag string) (commands []string, err error) {
t += tags

snippetTexts[t] = s
if config.Flag.Color {
if config.Flag.Color || config.Conf.General.Color {
t = fmt.Sprintf("[%s]: %s%s",
color.HiRedString(s.Description), command, color.HiCyanString(tags))
}
Expand Down
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type GeneralConfig struct {
SelectCmd string
Backend string
SortBy string
Color bool
Cmd []string
}

Expand Down Expand Up @@ -123,6 +124,7 @@ func (cfg *Config) Load(file string) error {
cfg.General.Column = 40
cfg.General.SelectCmd = "fzf --ansi --layout=reverse --border --height=90% --pointer=* --cycle --prompt=Snippets:"
cfg.General.Backend = "gist"
cfg.General.Color = false

cfg.Gist.FileName = "pet-snippet.toml"

Expand Down

0 comments on commit 2bcdff6

Please sign in to comment.