mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-12 10:52:39 +08:00
+1
-1
@@ -4630,7 +4630,7 @@ func (t *Terminal) renderPreviewScrollbar(yoff int, barLength int, barStart int)
|
|||||||
w := t.pborder.Width()
|
w := t.pborder.Width()
|
||||||
xw := [2]int{t.pwindow.Left(), t.pwindow.Width()}
|
xw := [2]int{t.pwindow.Left(), t.pwindow.Width()}
|
||||||
redraw := false
|
redraw := false
|
||||||
if len(t.previewer.bar) != height || t.previewer.xw != xw {
|
if len(t.previewer.bar) != height || t.previewer.xw != xw || t.previewed.version != t.previewer.version {
|
||||||
redraw = true
|
redraw = true
|
||||||
t.previewer.bar = make([]bool, height)
|
t.previewer.bar = make([]bool, height)
|
||||||
t.previewer.xw = xw
|
t.previewer.xw = xw
|
||||||
|
|||||||
@@ -623,4 +623,20 @@ class TestPreview < TestInteractive
|
|||||||
assert_equal(0, lines.count { |line| line.include?('│ h') })
|
assert_equal(0, lines.count { |line| line.include?('│ h') })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_preview_toggle_should_redraw_scrollbar
|
||||||
|
tmux.send_keys %(seq 1 | #{FZF} --no-border --scrollbar --preview 'seq $((FZF_PREVIEW_LINES + 1))' --preview-border line --bind tab:toggle-preview --header foo --header-border --footer bar --footer-border), :Enter
|
||||||
|
tmux.until do |lines|
|
||||||
|
assert_equal 1, lines.match_count
|
||||||
|
assert_operator lines.count { |line| line.end_with?('│') }, :>, 2
|
||||||
|
end
|
||||||
|
tmux.send_keys :Tab
|
||||||
|
tmux.until do |lines|
|
||||||
|
assert_equal(2, lines.count { |line| line.end_with?('│') })
|
||||||
|
end
|
||||||
|
tmux.send_keys :Tab
|
||||||
|
tmux.until do |lines|
|
||||||
|
assert_operator lines.count { |line| line.end_with?('│') }, :>, 2
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user