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 66 "time"
77
88 "github.com/jesseduffield/gocui"
9+ "github.com/jesseduffield/lazygit/pkg/commands/git_commands"
910 "github.com/jesseduffield/lazygit/pkg/gui/types"
1011 "github.com/samber/lo"
1112)
@@ -225,9 +226,29 @@ func (self *CommitsHelper) OpenCommitMenu(suggestionFunc func(string) []*types.S
225226 },
226227 Key : 'e' ,
227228 },
229+ {
230+ Label : self .c .Tr .AddCoAuthor ,
231+ OnPress : func () error {
232+ return self .addCoAuthor (suggestionFunc )
233+ },
234+ Key : 'c' ,
235+ },
228236 }
229237 return self .c .Menu (types.CreateMenuOptions {
230238 Title : self .c .Tr .CommitMenuTitle ,
231239 Items : menuItems ,
232240 })
233241}
242+
243+ func (self * CommitsHelper ) addCoAuthor (suggestionFunc func (string ) []* types.Suggestion ) error {
244+ return self .c .Prompt (types.PromptOpts {
245+ Title : self .c .Tr .AddCoAuthorPromptTitle ,
246+ FindSuggestionsFunc : suggestionFunc ,
247+ HandleConfirm : func (value string ) error {
248+ commitDescription := self .getCommitDescription ()
249+ commitDescription = git_commands .AddCoAuthorToDescription (commitDescription , value )
250+ self .setCommitDescription (commitDescription )
251+ return nil
252+ },
253+ })
254+ }
You can’t perform that action at this time.
0 commit comments