diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2021-01-03 00:00:40 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2021-01-03 00:15:00 +0900 |
commit | d779ff7e6dcf068fbcf743bed45127c3b857ec92 (patch) | |
tree | e50d90a35c8a59841eaad89af9c5718ab2663237 /src/core.go | |
parent | fd8858f8c93e38d50f00cd21430e21d89e2f9399 (diff) |
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
Diffstat (limited to 'src/core.go')
-rw-r--r-- | src/core.go | 8 |
1 files changed, 5 insertions, 3 deletions
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 { |