From d02b9442a56ec03dbb905d432762cf545603ef07 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 26 Oct 2023 00:22:28 +0900 Subject: (Experimental) Improve Sixel graphics support (#2544) Progress: * Sixel image can now be displayed with other text, and is scrollable * If an image can't be displayed entirely due to the scroll offset, fzf will render a wireframe to indicate that an image should be displayed * Renamed $FZF_PREVIEW_{WIDTH,HEIGHT} to $FZF_PREVIEW_PIXEL_{WIDTH,HEIGHT} for clarity * Added bin/fzf-preview.sh script to demonstrate how to display an image using Kitty or Sixel protocol An example: ls *.jpg | fzf --preview='seq $((FZF_PREVIEW_LINES*9/10)); fzf-preview.sh {}; seq 100' A known issue: * If you reduce the size of the preview window, the image may extend beyond the preview window --- src/tui/dummy.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/tui/dummy.go') diff --git a/src/tui/dummy.go b/src/tui/dummy.go index d893a747..13c2aeec 100644 --- a/src/tui/dummy.go +++ b/src/tui/dummy.go @@ -38,9 +38,7 @@ func (r *FullscreenRenderer) Clear() {} func (r *FullscreenRenderer) NeedScrollbarRedraw() bool { return false } func (r *FullscreenRenderer) Refresh() {} func (r *FullscreenRenderer) Close() {} -func (r *FullscreenRenderer) Size() (termSize, error) { - return termSize{}, nil -} +func (r *FullscreenRenderer) Size() TermSize { return TermSize{} } func (r *FullscreenRenderer) GetChar() Event { return Event{} } func (r *FullscreenRenderer) MaxX() int { return 0 } -- cgit v1.2.3