Compare commits

..
Author SHA1 Message Date
Junegunn Choi 314cbe1be7 Fix --info inline-right:PREFIX not clearing previous output
Close #4953
2026-11-11 19:26:21 +09:00
3 changed files with 15 additions and 1 deletions

No files matched your search

+4
View File
@@ -1,6 +1,10 @@
CHANGELOG
=========
0.75.1
------
- Fixed `--info inline-right:PREFIX` leaving part of the previous output when the info gets shorter (#4953)
0.75.0
------
- Added `{change,transform,bg-transform}-info-command` actions (#4951) (@casperdcl)
+4 -1
View File
@@ -3664,7 +3664,10 @@ func (t *Terminal) printInfoImpl() {
pos++
}
} else {
pos = max(pos, t.window.Width()-outputLen-util.StringWidth(t.infoPrefix)-1)
move(line, pos, false)
newPos := max(pos, t.window.Width()-outputLen-util.StringWidth(t.infoPrefix)-1)
t.window.Print(strings.Repeat(" ", newPos-pos))
pos = newPos
printInfoPrefix()
}
}
+7
View File
@@ -1792,6 +1792,13 @@ class TestCore < TestInteractive
tmux.until { assert_match(%r{ 0/100000}, it[-1]) }
end
def test_info_inline_right_prefix_clearance
tmux.send_keys "seq 100000 | #{FZF} --info 'inline-right:xx '", :Enter
tmux.until { assert_match(%r{xx 100000/100000}, it[-1]) }
tmux.send_keys 'x'
tmux.until { assert_match(%r{ xx 0/100000}, it[-1]) }
end
def test_info_command
tmux.send_keys(%(seq 10000 | #{FZF} --separator x --info-command 'echo -e "--\\x1b[33m$FZF_POS\\x1b[m/$FZF_INFO--"'), :Enter)
tmux.until { assert_match(%r{^ --1/10000/10000-- xx}, it[-2]) }