From d779ff7e6dcf068fbcf743bed45127c3b857ec92 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 3 Jan 2021 00:00:40 +0900 Subject: Make search toggleable - `--phony` renamed to `--disabled` for consistency - `--no-phony` is now `--enabled` - Added `enable-search`, `disable-search`, and `toggle-search` actions for `--bind` - Added `--color` options: `query` and `disabled` Close #2303 --- src/core.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/core.go') diff --git a/src/core.go b/src/core.go index ef470a80..1c009c69 100644 --- a/src/core.go +++ b/src/core.go @@ -237,14 +237,16 @@ func Run(opts *Options, version string, revision string) { go reader.restart(command) } eventBox.Watch(EvtReadNew) + query := []rune{} for { delay := true ticks++ input := func() []rune { - if opts.Phony { - return []rune{} + paused, input := terminal.Input() + if !paused { + query = input } - return []rune(terminal.Input()) + return query } eventBox.Wait(func(events *util.Events) { if _, fin := (*events)[EvtReadFin]; fin { -- cgit v1.2.3