Add docs for menuFromCommand prompts

This commit is contained in:
Elwardi 2021-07-17 19:18:41 +01:00
parent d18c8c8dc3
commit 9daa47fb2d
2 changed files with 19 additions and 3 deletions

View file

@ -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)
}