mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-12 08:36:25 -04:00
Preserve commit message when quitting while the commit message panel is open
This isn't possible with the default quit binding ('q'), but there's an
alternative binding (ctrl-c) that does work while the panel is open; also, users
can rebind quit to something like ctrl-q.
This commit is contained in:
parent
afbfbb27a4
commit
337ab2a276
|
|
@ -91,6 +91,12 @@ func (self *CommitDescriptionController) GetOnFocus() func(types.OnFocusOpts) {
|
|||
}
|
||||
}
|
||||
|
||||
func (self *CommitDescriptionController) GetOnQuit() func() {
|
||||
return func() {
|
||||
self.c.Helpers().Commits.PreserveCommitMessage()
|
||||
}
|
||||
}
|
||||
|
||||
func (self *CommitDescriptionController) switchToCommitMessage() error {
|
||||
self.c.Context().Replace(self.c.Contexts().CommitMessage)
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -82,6 +82,12 @@ func (self *CommitMessageController) GetOnFocusLost() func(types.OnFocusLostOpts
|
|||
}
|
||||
}
|
||||
|
||||
func (self *CommitMessageController) GetOnQuit() func() {
|
||||
return func() {
|
||||
self.c.Helpers().Commits.PreserveCommitMessage()
|
||||
}
|
||||
}
|
||||
|
||||
func (self *CommitMessageController) Context() types.Context {
|
||||
return self.context()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue