mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Support using command output directly in menuFromCommand custom command prompt
The menuFromCommand option is a little complicated, so I'm adding an easy way to just use the command output directly, where each line becomes a suggestion, as-is. Now that we support suggestions in the input prompt, there's less of a need for menuFromCommand, but it probably still serves some purpose. In future I want to support this filter/valueFormat/labelFormat thing for suggestions too. I would like to think a little more about the interface though: is using a regex like we currently do really the simplest approach?
This commit is contained in:
parent
036a1ea519
commit
1de876ed4d
4 changed files with 80 additions and 25 deletions
|
@ -210,7 +210,7 @@ func (self *HandlerCreator) menuPromptFromCommand(prompt *config.CustomCommandPr
|
|||
return self.c.Error(err)
|
||||
}
|
||||
|
||||
menuItems := slices.Map(candidates, func(candidate *commandMenuEntry) *types.MenuItem {
|
||||
menuItems := slices.Map(candidates, func(candidate *commandMenuItem) *types.MenuItem {
|
||||
return &types.MenuItem{
|
||||
LabelColumns: []string{candidate.label},
|
||||
OnPress: func() error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue