mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-18 11:05:16 +00:00
Fix Sixel issues (#2544)
* Fix regression where previous image is not properly cleared * Change the way fzf calculates the number of required lines to display an image (ceil -> floor) to fix the issue where an image is always rendered as a wireframe.
This commit is contained in:
parent
ec208af474
commit
96e31e4b78
@ -1936,6 +1936,7 @@ func (t *Terminal) renderPreviewSpinner() {
|
||||
|
||||
func (t *Terminal) renderPreviewArea(unchanged bool) {
|
||||
if t.previewed.wipe && t.previewed.version != t.previewer.version {
|
||||
t.previewed.wipe = false
|
||||
t.pwindow.Erase()
|
||||
} else if unchanged {
|
||||
t.pwindow.MoveAndClear(0, 0) // Clear scroll offset display
|
||||
@ -2029,8 +2030,8 @@ Loop:
|
||||
if isSixel {
|
||||
t.previewed.wipe = true
|
||||
if t.termSize.PxHeight > 0 {
|
||||
rows := util.Max(0, strings.Count(passThrough, "-")-1)
|
||||
requiredLines = int(math.Ceil(float64(rows*6*t.termSize.Lines) / float64(t.termSize.PxHeight)))
|
||||
rows := strings.Count(passThrough, "-")
|
||||
requiredLines = int(math.Floor(float64(rows*6*t.termSize.Lines) / float64(t.termSize.PxHeight)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -2168,7 +2169,6 @@ func (t *Terminal) printPreview() {
|
||||
t.previewed.numLines = numLines
|
||||
t.previewed.version = t.previewer.version
|
||||
t.previewed.offset = t.previewer.offset
|
||||
t.previewed.wipe = false
|
||||
}
|
||||
|
||||
func (t *Terminal) printPreviewDelayed() {
|
||||
|
Loading…
Reference in New Issue
Block a user