h.Relocate()
}
}
- InfoBar.Prompt(prompt, "", "Find", eventCallback, func(resp string, canceled bool) {
+ findCallback := func(resp string, canceled bool) {
// Finished callback
if !canceled {
match, found, err := h.Buf.FindNext(resp, h.Buf.Start(), h.Buf.End(), h.searchOrig, true, useRegex)
h.Cursor.ResetSelection()
}
h.Relocate()
- })
-
+ }
+ pattern := string(h.Cursor.GetSelection())
+ if eventCallback != nil && pattern != "" {
+ eventCallback(pattern)
+ }
+ InfoBar.Prompt(prompt, pattern, "Find", eventCallback, findCallback)
return true
}