mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
Add a commit menu to the commit message panel
And move the "switch to editor" command into this menu. So far this is the only entry, but we'll add another one in the next commit.
This commit is contained in:
parent
b8f4cd0ef6
commit
744519de60
9 changed files with 46 additions and 18 deletions
|
@ -48,8 +48,8 @@ func (self *CommitMessageController) GetKeybindings(opts types.KeybindingsOpts)
|
|||
Handler: self.switchToCommitDescription,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.CommitMessage.SwitchToEditor),
|
||||
Handler: self.switchToEditor,
|
||||
Key: opts.GetKey(opts.Config.CommitMessage.CommitMenu),
|
||||
Handler: self.openCommitMenu,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -89,10 +89,6 @@ func (self *CommitMessageController) switchToCommitDescription() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (self *CommitMessageController) switchToEditor() error {
|
||||
return self.c.Helpers().Commits.SwitchToEditor()
|
||||
}
|
||||
|
||||
func (self *CommitMessageController) handleCommitIndexChange(value int) error {
|
||||
currentIndex := self.context().GetSelectedIndex()
|
||||
newIndex := currentIndex + value
|
||||
|
@ -134,3 +130,8 @@ func (self *CommitMessageController) confirm() error {
|
|||
func (self *CommitMessageController) close() error {
|
||||
return self.c.Helpers().Commits.CloseCommitMessagePanel()
|
||||
}
|
||||
|
||||
func (self *CommitMessageController) openCommitMenu() error {
|
||||
authorSuggestion := self.c.Helpers().Suggestions.GetAuthorsSuggestionsFunc()
|
||||
return self.c.Helpers().Commits.OpenCommitMenu(authorSuggestion)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue