Restore scroll after rendering full-height Sixel image (#2544)

When a Sixel image touches the bottom of the screen, the whole screen
scrolls up one line to make room for the cursor. Add an ANSI escape
code to compensate for the movement. Unfortunately, the movement of the
screen is sometimes noticeable.

  fzf --preview='fzf-preview.sh {}' --preview-window border-left
This commit is contained in:
Junegunn Choi
2023-10-31 23:29:47 +09:00
parent 1cfa3ee4c7
commit 278dce9ba6

View File

@@ -2061,7 +2061,10 @@ Loop:
if requiredLines > 0 {
if y+requiredLines == height {
t.pwindow.Move(y+requiredLines, 0)
if t.tui.MaxY() == t.pwindow.Top()+height {
t.tui.PassThrough("\x1b[1T")
}
t.pwindow.Move(height-1, maxWidth-1)
t.previewed.filled = true
break Loop
} else {