my previous detection for continueous input was completely wrong.
Now we just assume that anything coming in from Stdin could be infinite.
Additionally, in case we think it's infinite but we were actually able
to close the Reader stream, we consider it non-infinite after that
point.
... by punting the problem when the input is an infinite stream.
This commit fixes the blocking, but the subsequent queries don't seem
to be properly running
refs #494
This is required because we need to make sure we know termbox
has been initialized before attempting to make another drawing
operation.
Notably, without proper termbox initialization, screen.Size() returns a
bogus value, and we miss the line location where we left off to execute
the external command specified by --exec
--exec is a new, and far better tool to execute external commands
from peco results. It is invoked when `Finish` action is called,
and pipes selected line(s) to the specified command. If there were
saved lines, every saved line plus the currently selected line is
piped to the command. Otherwise, only the currently selected line
is piped.
When the command exits, execution goes back to peco, where you can
keep doing incremental searches, and again execute external commands.
When you are done, you are expected to exit out of peco using
the `Cancel` action
This makes sure that termbox does not inadvertantly steal our
commands while executing external commands, and also makes sure
we explicitly reset the screen.
Also, make sure we use a temporary selection.
- The fuzzy finder is implemented as a new filter, which
re-uses the RegexpFilter.
- A new queryTransformer field has been added to the RegexpFilter
struct to allow changing the user query before applying the filter.
- The new queryTransformer is used for the fuzzy filter to change
the user query into a regexp.
- Also added a test in filter_test.go
I should've done this a long time ago, but what's done is done.
There was one more omission between v0.3.x and v0.4.x, which is
buffer-size :/
At least I'm glad I got this out of the way.