mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +02:00
Add docs for menuFromCommand prompts
This commit is contained in:
parent
d18c8c8dc3
commit
9daa47fb2d
2 changed files with 19 additions and 3 deletions
|
@ -179,11 +179,11 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand config.CustomCommand
|
|||
var candidates []string
|
||||
reg := regexp.MustCompile(filter)
|
||||
for _,str := range strings.Split(string(message), "\n"){
|
||||
cand := str
|
||||
cand := ""
|
||||
if str != "" {
|
||||
for i := 1; i < (reg.NumSubexp()+1); i++ {
|
||||
trim := reg.ReplaceAllString(str, "${"+fmt.Sprint(i)+"}")
|
||||
cand = strings.Trim(cand, trim)
|
||||
keep := reg.ReplaceAllString(str, "${"+fmt.Sprint(i)+"}")
|
||||
cand += keep
|
||||
}
|
||||
candidates = append(candidates, cand)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue