From 3148b0f3e88f8a116491135dc10a7ce6d96899bf Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 9 Dec 2024 18:27:02 +0900 Subject: [PATCH] Restore previous behavior --- src/terminal.go | 3 +++ test/test_go.rb | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/terminal.go b/src/terminal.go index 9de92e3..adca67a 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -1695,6 +1695,9 @@ func (t *Terminal) resizeWindows(forcePreview bool) { marginInt[0], marginInt[3], width-pwidth, height, false, noBorder) // NOTE: fzf --preview 'cat {}' --preview-window border-left --border x := marginInt[3] + width - pwidth + if !previewOpts.border.HasRight() && t.borderShape.HasRight() { + pwidth++ + } createPreviewWindow(marginInt[0], x, pwidth, height) } } diff --git a/test/test_go.rb b/test/test_go.rb index 40794b3..105e8ef 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -3081,6 +3081,13 @@ class TestGoFZF < TestBase end end + def test_preview_window_width_exception + tmux.send_keys "seq 10 | #{FZF} --scrollbar --preview-window border-left --border --preview 'seq 1000'", :Enter + tmux.until do |lines| + assert lines[1]&.end_with?(' 1/1000││') + end + end + def test_become tmux.send_keys "seq 100 | #{FZF} --bind 'enter:become:seq {} | #{FZF}'", :Enter tmux.until { |lines| assert_equal 100, lines.item_count }