mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-06-01 07:00:47 +00:00
Fix a bug of height range with -1 or -0 (#3226)
Fixed a bug that when both heightUnknown and deferred are true, deferred is not properly reset and the program terminates abnormally. Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
This commit is contained in:
parent
025aa33773
commit
fb019d43bf
|
@ -219,6 +219,7 @@ func Run(opts *Options, version string, revision string) {
|
||||||
determine := func(final bool) {
|
determine := func(final bool) {
|
||||||
if heightUnknown {
|
if heightUnknown {
|
||||||
if total >= maxFit || final {
|
if total >= maxFit || final {
|
||||||
|
deferred = false
|
||||||
heightUnknown = false
|
heightUnknown = false
|
||||||
terminal.startChan <- fitpad{util.Min(total, maxFit), padHeight}
|
terminal.startChan <- fitpad{util.Min(total, maxFit), padHeight}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2716,6 +2716,13 @@ class TestGoFZF < TestBase
|
||||||
assert(lines.any? { _1.include?('only match') })
|
assert(lines.any? { _1.include?('only match') })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_height_range_with_exit_0
|
||||||
|
tmux.send_keys "seq 10 | #{FZF} --height ~10% --exit-0", :Enter
|
||||||
|
tmux.until { |lines| assert_equal 10, lines.item_count }
|
||||||
|
tmux.send_keys :c
|
||||||
|
tmux.until { |lines| assert_equal 0, lines.match_count }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module TestShell
|
module TestShell
|
||||||
|
|
Loading…
Reference in New Issue
Block a user