summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-12-09 18:27:02 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-12-12 13:53:08 +0900
commit3148b0f3e88f8a116491135dc10a7ce6d96899bf (patch)
treec83e3286e5fe2a42adeca7713ab02cf2de9a5367
parent3fc0bd26a59c78beba62b610061db59b552e2e74 (diff)
downloadfzf-3148b0f3e88f8a116491135dc10a7ce6d96899bf.tar.gz
Restore previous behavior
-rw-r--r--src/terminal.go3
-rwxr-xr-xtest/test_go.rb7
2 files changed, 10 insertions, 0 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 9de92e3c..adca67a3 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 40794b3c..105e8ef0 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 }