De-duplicate code and reduce the amount of code that has to be changed
when new BorderShapes are being added. This also adds and uses the
missing HasBottom().
When the chosen preview border shape has no left and/or right border,
the minimum total preview window size decreases. But due to the
hardcoded value for the minimum size of the preview window the size
could not be decreased further than 5.
The minimum window height decreases when no extra line for the
horizontal separator is used (e.g. with `--info=inline --no-separator`).
In this case the preview window should be able to occupy this extra
line.
Enable resizing the preview window by dragging its border with the
mouse. This works with all border styles except for `none`.
Counter-intuitively, having the border only on the opposite side of the
window works too - dragging from it will first decrease the preview size
to its minimum.
We cache a merger for partial input as well, because it is automatically
invalidated as soon as the new data comes in.
However, there was a race condition where a cached merger for a partial
input is used even after the input stream was complete. This commit
fixes the problem.
Fix#4034
Only requiring '-suffix in --exact mode is confusing and not
straightforward. Requiring '-prefix in --exact mode means that
the users can experience unintended mode switches while typing.
e.g.
'it -> fuzzy (many results)
'it' -> boundary (few results)
'it's -> fuzzy (many results)
However, user who intends to input a boundary query should not be
interested in the intermediate results, and the number of matches
decreases as she types, so it should be okay.
On the other hand, user who does intend to type "it's" will be surprised
by the sudden decrease of the match count, but eventually get the right
result.
This command would cause a deadlock and make fzf crash:
fzf --bind 'start:reload:ls' --height ~100%
Because,
1. 'start' event is handled by Terminal
2. When 'reload' is bound to 'start', fzf avoids starting the initial reader
3. Terminal waits for the initial input to find the right height when
adaptive height is used
4. Because the initial reader is not started, Terminal never gets the
initial list
5. No chance to trigger 'start:reload', hence deadlock
This commit fixes the above problem by extracting the reload command
bound to 'start' event and starting the initial reader with that command
instead of letting Terminal start it.
This commit also makes the environment variables available to
$FZF_DEFAULT_COMMAND.
FZF_DEFAULT_COMMAND='echo $FZF_QUERY' fzf --query foo
Fix#3944
This reverts commit dca2262fe6f8d7c4a9264464e45d44e684d0e70b.
> For mouse support on mintty
> Fix#3847
The current implementation LightRenderer for Windows is unable to accept
non-ASCII input unlike the tcell renderer. So even though it supports
mouse on mintty, we shouldn't use it as the default.
* #3799
* #3847