diff --git a/internal/action/actions.go b/internal/action/actions.go index beb63b07..892bc555 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -903,7 +903,7 @@ func (h *BufPane) find(useRegex bool) bool { 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) @@ -926,8 +926,12 @@ func (h *BufPane) find(useRegex bool) bool { 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 }