mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-16 22:10:26 +00:00
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.
This commit is contained in:
parent
6d5beb50ba
commit
3bfd367d87
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue