Skip to content
Myr

Fix --info inline-right not properly clearing the previous output

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

(seq 100000; sleep 1) | fzf --info inline-right --bind load:change-query:x

authored by Junegunn Choi · committed by Junegunn Choi · parent dba1644 · Browse files · 2 files+11 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+11 added−2 removed

  • tests:+7 added−0 removed
  • other:+4 added−2 removed

2 files+11 added−2 removed

modified:src/terminal.go+4 added-2 removed
1713 unmodified lines
1714 }17151716 if t.infoStyle == infoInlineRight {1717 if len(t.infoPrefix) == 0 {1718 t.move(line, pos, false)1718 pos = util.Max(pos, t.window.Width()-util.StringWidth(output)-3)1719 newPos := util.Max(pos, t.window.Width()-util.StringWidth(output)-3)1720 t.window.Print(strings.Repeat(" ", newPos-pos))1721 pos = newPos1722 if pos < t.window.Width() {1720 t.move(line, pos, false)1723 printSpinner()1724 pos++1725 }1726 if pos < t.window.Width()-1 {
2568 unmodified lines
modified:test/test_go.rb+7 added
2968 unmodified lines
2969 tmux.send_keys "#{FZF} --info=inline-right --bind 'start:reload:seq 100; sleep 10'", :Enter2970 tmux.until { assert_match(%r{[⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏] 100/100}, _1[-1]) }2971 end29722973 def test_info_inline_right_clearance2974 tmux.send_keys "seq 100000 | #{FZF} --info inline-right", :Enter2975 tmux.until { assert_match(%r{100000/100000}, _1[-1]) }2976 tmux.send_keys 'x'2977 tmux.until { assert_match(%r{ 0/100000}, _1[-1]) }2978 end29792980 def test_prev_next_selected2981 tmux.send_keys 'seq 10 | fzf --multi --bind ctrl-n:next-selected,ctrl-p:prev-selected', :Enter2982 tmux.until { |lines| assert_equal 10, lines.item_count }2983 tmux.send_keys :BTab, :BTab, :Up, :BTab
807 unmodified lines