Skip to content

Commit

Permalink
Restore previous behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Dec 9, 2024
1 parent f85792c commit 1612151
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
7 changes: 7 additions & 0 deletions test/test_go.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3081,6 +3081,13 @@ def test_alternative_preview_window_opts
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 }
Expand Down

0 comments on commit 1612151

Please sign in to comment.