From 01d82749b17cd7a048d69c8386044d79548f7893 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 26 Oct 2021 09:39:28 +1100 Subject: [PATCH] fix commit message prefix thingo --- pkg/gui/files_panel.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 0f9bbd65d..cce28353e 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -393,10 +393,11 @@ func (gui *Gui) handleCommitPress() error { return gui.createErrorPanel(fmt.Sprintf("%s: %s", gui.Tr.LcCommitPrefixPatternError, err.Error())) } prefix := rgx.ReplaceAllString(gui.getCheckedOutBranch().Name, prefixReplace) - gui.renderString(gui.Views.CommitMessage, prefix) - if err := gui.Views.CommitMessage.SetCursor(len(prefix), 0); err != nil { - return err - } + gui.Views.CommitMessage.ClearTextArea() + gui.Views.CommitMessage.TextArea.TypeString(prefix) + gui.g.Update(func(*gocui.Gui) error { + return nil + }) } gui.g.Update(func(g *gocui.Gui) error {