From 3bfd367d87c4f143dfb22515876d4099d44bd8ec Mon Sep 17 00:00:00 2001 From: Dmitry Maluka Date: Wed, 9 Jun 2021 23:04:11 +0200 Subject: [PATCH] find: select prefilled text (#2127) The new feature of prefilling the search bar with the selected text (added in 3d0b5db) has an annoying side effect: if we do have some text selected but we want to search for some other pattern, not the selected text, then we have to manually delete the prefilled text before we can start entering our wanted search pattern. A simple solution is to select the prefilled text, so that we can replace it with our pattern right away just by typing, without any additional keystrokes. --- internal/action/actions.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/action/actions.go b/internal/action/actions.go index 892bc555..17875c69 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -932,6 +932,9 @@ func (h *BufPane) find(useRegex bool) bool { eventCallback(pattern) } InfoBar.Prompt(prompt, pattern, "Find", eventCallback, findCallback) + if pattern != "" { + InfoBar.SelectAll() + } return true }