summaryrefslogtreecommitdiffstats
path: root/src/core.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2019-11-09 22:54:48 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2019-11-10 11:36:55 +0900
commit11962dabba69e706246bfcd54fa42b1e1c6bee8b (patch)
tree79eb580d68ed9da6643cc08aca75c432e7ff4e88 /src/core.go
parentdceb5d09cdb0d3158a3f79e59eb3c16ffe242d6b (diff)
Add --phony option for disabling search
With --phony, fzf becomes a simply selector interface without its own search functionality. The query string is only used for building the command for preview or execute action. Close #1723
Diffstat (limited to 'src/core.go')
-rw-r--r--src/core.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core.go b/src/core.go
index 2db5b3ae..ae8c8ebe 100644
--- a/src/core.go
+++ b/src/core.go
@@ -227,6 +227,12 @@ func Run(opts *Options, revision string) {
for {
delay := true
ticks++
+ input := func() []rune {
+ if opts.Phony {
+ return []rune{}
+ }
+ return []rune(terminal.Input())
+ }
eventBox.Wait(func(events *util.Events) {
if _, fin := (*events)[EvtReadFin]; fin {
delete(*events, EvtReadNew)
@@ -241,7 +247,7 @@ func Run(opts *Options, revision string) {
if opts.Sync {
terminal.UpdateList(PassMerger(&snapshot, opts.Tac))
}
- matcher.Reset(snapshot, terminal.Input(), false, !reading, sort)
+ matcher.Reset(snapshot, input(), false, !reading, sort)
case EvtSearchNew:
switch val := value.(type) {
@@ -249,7 +255,7 @@ func Run(opts *Options, revision string) {
sort = val
}
snapshot, _ := chunkList.Snapshot()
- matcher.Reset(snapshot, terminal.Input(), true, !reading, sort)
+ matcher.Reset(snapshot, input(), true, !reading, sort)
delay = false
case EvtSearchProgress: