Skip to content
Myr

Fix a bug of height range with -1 or -0 (#3226)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixed a bug that when both heightUnknown and deferred are true, deferred is not properly reset and the program terminates abnormally.

authored by tyama711 · committed by GitHub · parent 025aa33 · Browse files · 2 files+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>

Diff stats

2 files+8 added−0 removed

  • tests:+7 added−0 removed
  • other:+1 added−0 removed

2 files+8 added−0 removed

modified:src/core.go+1 added
217 unmodified lines
218 query := []rune{}219 determine := func(final bool) {220 if heightUnknown {221 if total >= maxFit || final {222 deferred = false223 heightUnknown = false224 terminal.startChan <- fitpad{util.Min(total, maxFit), padHeight}225 }226 } else if deferred {
150 unmodified lines
modified:test/test_go.rb+7 added
2714 unmodified lines
2715 assert_equal 1, lines.match_count2716 assert(lines.any? { _1.include?('only match') })2717 end2718 end27192720 def test_height_range_with_exit_02721 tmux.send_keys "seq 10 | #{FZF} --height ~10% --exit-0", :Enter2722 tmux.until { |lines| assert_equal 10, lines.item_count }2723 tmux.send_keys :c2724 tmux.until { |lines| assert_equal 0, lines.match_count }2725 end2726end27272728module TestShell2729 def setup
481 unmodified lines