Skip to content

Commit

Permalink
Redraw/hide scroll offset when 'info' property is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Sep 12, 2024
1 parent 952276d commit 2191a44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (a previewOpts) sameLayout(b previewOpts) bool {
}

func (a previewOpts) sameContentLayout(b previewOpts) bool {
return a.wrap == b.wrap && a.headerLines == b.headerLines
return a.wrap == b.wrap && a.headerLines == b.headerLines && a.info == b.info
}

func firstLine(s string) string {
Expand Down
7 changes: 6 additions & 1 deletion test/test_go.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3381,11 +3381,16 @@ def test_boundary_match

def test_preview_window_noinfo
# │ 1 ││
tmux.send_keys %(#{FZF} --preview 'seq 1000' --preview-window top,noinfo --scrollbar), :Enter
tmux.send_keys %(#{FZF} --preview 'seq 1000' --preview-window top,noinfo --scrollbar --bind space:change-preview-window:info), :Enter
tmux.until do |lines|
assert lines[1]&.start_with?('│ 1')
assert lines[1]&.end_with?(' ││')
end
tmux.send_keys :Space
tmux.until do |lines|
assert lines[1]&.start_with?('│ 1')
assert lines[1]&.end_with?('1000││')
end
end
end

Expand Down

0 comments on commit 2191a44

Please sign in to comment.