1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-19 12:12:42 +02:00

allow hiding random tip

This commit is contained in:
Jesse Duffield 2021-04-12 21:41:12 +10:00
parent 76697280c9
commit 4fb2dba587
3 changed files with 11 additions and 6 deletions

View File

@ -41,6 +41,7 @@ gui:
skipUnstageLineWarning: false skipUnstageLineWarning: false
skipStashWarning: true skipStashWarning: true
showFileTree: false # for rendering changes files in a tree format showFileTree: false # for rendering changes files in a tree format
showRandomTip: true
showCommandLog: true showCommandLog: true
commandLogSize: 8 commandLogSize: 8
git: git:

View File

@ -36,6 +36,7 @@ type GuiConfig struct {
CommitLength CommitLengthConfig `yaml:"commitLength"` CommitLength CommitLengthConfig `yaml:"commitLength"`
SkipNoStagedFilesWarning bool `yaml:"skipNoStagedFilesWarning"` SkipNoStagedFilesWarning bool `yaml:"skipNoStagedFilesWarning"`
ShowFileTree bool `yaml:"showFileTree"` ShowFileTree bool `yaml:"showFileTree"`
ShowRandomTip bool `yaml:"showRandomTip"`
ShowCommandLog bool `yaml:"showCommandLog"` ShowCommandLog bool `yaml:"showCommandLog"`
CommandLogSize int `yaml:"commandLogSize"` CommandLogSize int `yaml:"commandLogSize"`
} }
@ -303,6 +304,7 @@ func GetDefaultConfig() *UserConfig {
SkipNoStagedFilesWarning: false, SkipNoStagedFilesWarning: false,
ShowCommandLog: true, ShowCommandLog: true,
ShowFileTree: false, ShowFileTree: false,
ShowRandomTip: true,
CommandLogSize: 8, CommandLogSize: 8,
}, },
Git: GitConfig{ Git: GitConfig{

View File

@ -46,6 +46,7 @@ func (gui *Gui) printCommandLogHeader() {
) )
fmt.Fprintln(gui.Views.Extras, utils.ColoredString(introStr, color.FgCyan)) fmt.Fprintln(gui.Views.Extras, utils.ColoredString(introStr, color.FgCyan))
if gui.Config.GetUserConfig().Gui.ShowRandomTip {
fmt.Fprintf( fmt.Fprintf(
gui.Views.Extras, gui.Views.Extras,
"%s: %s", "%s: %s",
@ -53,6 +54,7 @@ func (gui *Gui) printCommandLogHeader() {
utils.ColoredString(gui.getRandomTip(), color.FgGreen), utils.ColoredString(gui.getRandomTip(), color.FgGreen),
) )
} }
}
func (gui *Gui) getRandomTip() string { func (gui *Gui) getRandomTip() string {
config := gui.Config.GetUserConfig().Keybinding config := gui.Config.GetUserConfig().Keybinding