summaryrefslogtreecommitdiffstats
path: root/pkg/gui/commit_message_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-09-05 23:02:13 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-09-05 23:02:13 +1000
commita2d40cfbf1df9c6cd7107e9356cca6dbac031f40 (patch)
treecda6bc640b3a7845a20c65c70e53dcda1c93694a /pkg/gui/commit_message_panel.go
parent986774e5c7ddf5c1de1e1adb831baac84a2dae66 (diff)
allow users to configure whether the commit length is shown
Diffstat (limited to 'pkg/gui/commit_message_panel.go')
-rw-r--r--pkg/gui/commit_message_panel.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/gui/commit_message_panel.go b/pkg/gui/commit_message_panel.go
index 7ac566b3f..99d649102 100644
--- a/pkg/gui/commit_message_panel.go
+++ b/pkg/gui/commit_message_panel.go
@@ -71,9 +71,17 @@ func (gui *Gui) simpleEditor(v *gocui.View, key gocui.Key, ch rune, mod gocui.Mo
v.EditWrite(ch)
}
- v.Subtitle = gui.getBufferLength(v)
+ gui.RenderCommitLength()
}
func (gui *Gui) getBufferLength(view *gocui.View) string {
return " " + strconv.Itoa(strings.Count(view.Buffer(), "")-1) + " "
}
+
+func (gui *Gui) RenderCommitLength() {
+ if !gui.Config.GetUserConfig().GetBool("gui.commitLength.show") {
+ return
+ }
+ v := gui.getCommitMessageView(gui.g)
+ v.Subtitle = gui.getBufferLength(v)
+}