diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-12 21:41:12 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-12 21:48:08 +1000 |
commit | 4fb2dba5870deb5c8b8f4cba494bc1d51df64762 (patch) | |
tree | bb79ede2e0fba4965d8896533044dcd788d84121 | |
parent | 76697280c9d0397d75b6af732a5c0b4617ea7809 (diff) |
allow hiding random tip
-rw-r--r-- | docs/Config.md | 1 | ||||
-rw-r--r-- | pkg/config/user_config.go | 2 | ||||
-rw-r--r-- | pkg/gui/command_log_panel.go | 14 |
3 files changed, 11 insertions, 6 deletions
diff --git a/docs/Config.md b/docs/Config.md index ec7d14eae..09f5d3698 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -41,6 +41,7 @@ gui: skipUnstageLineWarning: false skipStashWarning: true showFileTree: false # for rendering changes files in a tree format + showRandomTip: true showCommandLog: true commandLogSize: 8 git: diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 1d1f42b68..377646d18 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -36,6 +36,7 @@ type GuiConfig struct { CommitLength CommitLengthConfig `yaml:"commitLength"` SkipNoStagedFilesWarning bool `yaml:"skipNoStagedFilesWarning"` ShowFileTree bool `yaml:"showFileTree"` + ShowRandomTip bool `yaml:"showRandomTip"` ShowCommandLog bool `yaml:"showCommandLog"` CommandLogSize int `yaml:"commandLogSize"` } @@ -303,6 +304,7 @@ func GetDefaultConfig() *UserConfig { SkipNoStagedFilesWarning: false, ShowCommandLog: true, ShowFileTree: false, + ShowRandomTip: true, CommandLogSize: 8, }, Git: GitConfig{ diff --git a/pkg/gui/command_log_panel.go b/pkg/gui/command_log_panel.go index 2558e969e..469fbd1a1 100644 --- a/pkg/gui/command_log_panel.go +++ b/pkg/gui/command_log_panel.go @@ -46,12 +46,14 @@ func (gui *Gui) printCommandLogHeader() { ) fmt.Fprintln(gui.Views.Extras, utils.ColoredString(introStr, color.FgCyan)) - fmt.Fprintf( - gui.Views.Extras, - "%s: %s", - utils.ColoredString(gui.Tr.RandomTip, color.FgYellow), - utils.ColoredString(gui.getRandomTip(), color.FgGreen), - ) + if gui.Config.GetUserConfig().Gui.ShowRandomTip { + fmt.Fprintf( + gui.Views.Extras, + "%s: %s", + utils.ColoredString(gui.Tr.RandomTip, color.FgYellow), + utils.ColoredString(gui.getRandomTip(), color.FgGreen), + ) + } } func (gui *Gui) getRandomTip() string { |