Skip to content
Myr

Fix double subtraction of header lines from FZF_TOTAL_COUNT

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

Close #4692

authored by Junegunn Choi · committed by Junegunn Choi · parent ff6a3bb · Browse files · 2 files+2 added−2 removed
This commit

State

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

Diff stats

2 files+2 added−2 removed

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

2 files+2 added−2 removed

modified:src/terminal.go+1 added-1 removed
1370 unmodified lines
1371 env = append(env, "FZF_WRAP=char")1372 }1373 }1374 env = append(env, "FZF_INPUT_STATE="+inputState)1375 env = append(env, fmt.Sprintf("FZF_TOTAL_COUNT=%d", max(0, t.count-t.headerLines)))1375 env = append(env, fmt.Sprintf("FZF_TOTAL_COUNT=%d", t.count))1376 env = append(env, fmt.Sprintf("FZF_MATCH_COUNT=%d", t.resultMerger.Length()))1377 env = append(env, fmt.Sprintf("FZF_SELECT_COUNT=%d", len(t.selected)))1378 env = append(env, fmt.Sprintf("FZF_LINES=%d", t.areaLines))1379 env = append(env, fmt.Sprintf("FZF_COLUMNS=%d", t.areaColumns))
6332 unmodified lines
modified:test/test_core.rb+1 added-1 removed
1753 unmodified lines
1754 [key.to_sym, val]1755 end1756 end17571758 tmux.send_keys %(seq 100 | #{FZF} --multi --reverse --preview-window 0 --preview 'env | grep ^FZF_ | sort > #{tempname}' --no-input --bind enter:show-input+refresh-preview,space:disable-search+refresh-preview), :Enter1758 tmux.send_keys %({ echo foo; seq 100; } | #{FZF} --header-lines 1 --multi --reverse --preview-window 0 --preview 'env | grep ^FZF_ | sort > #{tempname}' --no-input --bind enter:show-input+refresh-preview,space:disable-search+refresh-preview), :Enter1759 expected = {1760 FZF_DIRECTION: 'down',1761 FZF_TOTAL_COUNT: '100',1762 FZF_MATCH_COUNT: '100',
499 unmodified lines