Skip to content

Commit

Permalink
Fix preview scrollbar with '--preview-window bottom,border-line'
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Jan 10, 2025
1 parent dfb88ed commit 43eafdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ func (o *previewOpts) HasBorderRight() bool {
return o.border.HasRight() || o.border == tui.BorderLine && o.position == posLeft
}

func (o *previewOpts) HasBorderTop() bool {
return o.border.HasTop() || o.border == tui.BorderLine && o.position == posDown
}

func defaultTmuxOptions(index int) *tmuxOptions {
return &tmuxOptions{
position: posCenter,
Expand Down
2 changes: 1 addition & 1 deletion src/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3231,7 +3231,7 @@ func (t *Terminal) renderPreviewScrollbar(yoff int, barLength int, barStart int)
xshift = -1
}
yshift := 1
if !t.activePreviewOpts.border.HasTop() {
if !t.activePreviewOpts.HasBorderTop() {
yshift = 0
}
for i := yoff; i < height; i++ {
Expand Down

0 comments on commit 43eafdf

Please sign in to comment.