mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04: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:
parent
5c61126c4b
commit
3de2a2d96c
|
|
@ -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("")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue