mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
Extract PreserveCommitMessage from CloseCommitMessagePanel
We'll want to call just the preservation step when the app is quitting with the commit message panel open: at that point the view-hiding and context-popping in CloseCommitMessagePanel are pointless (the app is about to exit), and some of the focus-lost side effects could be surprising during teardown.
This commit is contained in:
1 parent
5c61126c4b
commit
3de2a2d96c
1 file changed
+5
-1
@@ -173,13 +173,17 @@ func (self *CommitsHelper) HandleCommitConfirm() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *CommitsHelper) CloseCommitMessagePanel() {
|
||||
func (self *CommitsHelper) PreserveCommitMessage() {
|
||||
if self.c.Contexts().CommitMessage.GetPreserveMessage() {
|
||||
message := self.JoinCommitMessageAndUnwrappedDescription()
|
||||
if message != self.c.Contexts().CommitMessage.GetInitialMessage() {
|
||||
self.c.Contexts().CommitMessage.SetPreservedMessageAndLogError(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (self *CommitsHelper) CloseCommitMessagePanel() {
|
||||
self.PreserveCommitMessage()
|
||||
|
||||
self.c.Contexts().CommitMessage.SetHistoryMessage("")
|
||||
|
||||
|
||||
Reference in new issue
Block a user