File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
pkg/gui/controllers/helpers Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 55 "strings"
66 "time"
77
8+ "github.com/jesseduffield/lazygit/pkg/commands/git_commands"
89 "github.com/jesseduffield/lazygit/pkg/gui/types"
910 "github.com/samber/lo"
1011)
@@ -196,9 +197,29 @@ func (self *CommitsHelper) OpenCommitMenu(suggestionFunc func(string) []*types.S
196197 },
197198 Key : 'e' ,
198199 },
200+ {
201+ Label : self .c .Tr .AddCoAuthor ,
202+ OnPress : func () error {
203+ return self .addCoAuthor (suggestionFunc )
204+ },
205+ Key : 'c' ,
206+ },
199207 }
200208 return self .c .Menu (types.CreateMenuOptions {
201209 Title : self .c .Tr .CommitMenuTitle ,
202210 Items : menuItems ,
203211 })
204212}
213+
214+ func (self * CommitsHelper ) addCoAuthor (suggestionFunc func (string ) []* types.Suggestion ) error {
215+ return self .c .Prompt (types.PromptOpts {
216+ Title : self .c .Tr .AddCoAuthorPromptTitle ,
217+ FindSuggestionsFunc : suggestionFunc ,
218+ HandleConfirm : func (value string ) error {
219+ commitDescription := self .getCommitDescription ()
220+ commitDescription = git_commands .AddCoAuthorToDescription (commitDescription , value )
221+ self .setCommitDescription (commitDescription )
222+ return nil
223+ },
224+ })
225+ }
You can’t perform that action at this time.
0 commit comments