From 7588d5290b2fc05f2a33236c8b648a5aaf2d9d4a Mon Sep 17 00:00:00 2001 From: Andrei Yangabishev Date: Thu, 10 Jun 2021 11:26:29 +0300 Subject: [PATCH] ShowTotal flag --- docs/Config.md | 1 + go.mod | 2 +- pkg/config/user_config.go | 2 ++ pkg/gui/gui.go | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/Config.md b/docs/Config.md index 3dca4dc9d..ea248f9b9 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 + showTotal: true showRandomTip: true showCommandLog: true commandLogSize: 8 diff --git a/go.mod b/go.mod index f771216f5..aee0dba83 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/imdario/mergo v0.3.11 github.com/integrii/flaggy v1.4.0 github.com/jesseduffield/go-git/v5 v5.1.2-0.20201006095850-341962be15a4 - github.com/jesseduffield/gocui v0.3.1-0.20210417110745-37f79434200d + github.com/jesseduffield/gocui v0.3.2 github.com/jesseduffield/termbox-go v0.0.0-20200823212418-a2289ed6aafe // indirect github.com/jesseduffield/yaml v2.1.0+incompatible github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index b36c68bb5..a30591fc0 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -35,6 +35,7 @@ type GuiConfig struct { Theme ThemeConfig `yaml:"theme"` CommitLength CommitLengthConfig `yaml:"commitLength"` SkipNoStagedFilesWarning bool `yaml:"skipNoStagedFilesWarning"` + ShowTotal bool `yaml:"showTotal"` ShowFileTree bool `yaml:"showFileTree"` ShowRandomTip bool `yaml:"showRandomTip"` ShowCommandLog bool `yaml:"showCommandLog"` @@ -306,6 +307,7 @@ func GetDefaultConfig() *UserConfig { }, CommitLength: CommitLengthConfig{Show: true}, SkipNoStagedFilesWarning: false, + ShowTotal: true, ShowCommandLog: true, ShowFileTree: false, ShowRandomTip: true, diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 7c4968dd7..81f507542 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -496,6 +496,8 @@ func (gui *Gui) Run() error { g.ASCII = runtime.GOOS == "windows" && runewidth.IsEastAsian() + g.ShowTotal = userConfig.Gui.ShowTotal + if userConfig.Gui.MouseEvents { g.Mouse = true }