mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-06-04 08:20:50 +00:00
d02b9442a5
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
52 lines
1.6 KiB
Go
52 lines
1.6 KiB
Go
//go:build !tcell && !windows
|
|
|
|
package tui
|
|
|
|
type Attr int32
|
|
|
|
func HasFullscreenRenderer() bool {
|
|
return false
|
|
}
|
|
|
|
var DefaultBorderShape BorderShape = BorderRounded
|
|
|
|
func (a Attr) Merge(b Attr) Attr {
|
|
return a | b
|
|
}
|
|
|
|
const (
|
|
AttrUndefined = Attr(0)
|
|
AttrRegular = Attr(1 << 8)
|
|
AttrClear = Attr(1 << 9)
|
|
|
|
Bold = Attr(1)
|
|
Dim = Attr(1 << 1)
|
|
Italic = Attr(1 << 2)
|
|
Underline = Attr(1 << 3)
|
|
Blink = Attr(1 << 4)
|
|
Blink2 = Attr(1 << 5)
|
|
Reverse = Attr(1 << 6)
|
|
StrikeThrough = Attr(1 << 7)
|
|
)
|
|
|
|
func (r *FullscreenRenderer) Init() {}
|
|
func (r *FullscreenRenderer) Resize(maxHeightFunc func(int) int) {}
|
|
func (r *FullscreenRenderer) Pause(bool) {}
|
|
func (r *FullscreenRenderer) Resume(bool, bool) {}
|
|
func (r *FullscreenRenderer) PassThrough(string) {}
|
|
func (r *FullscreenRenderer) Clear() {}
|
|
func (r *FullscreenRenderer) NeedScrollbarRedraw() bool { return false }
|
|
func (r *FullscreenRenderer) Refresh() {}
|
|
func (r *FullscreenRenderer) Close() {}
|
|
func (r *FullscreenRenderer) Size() TermSize { return TermSize{} }
|
|
|
|
func (r *FullscreenRenderer) GetChar() Event { return Event{} }
|
|
func (r *FullscreenRenderer) MaxX() int { return 0 }
|
|
func (r *FullscreenRenderer) MaxY() int { return 0 }
|
|
|
|
func (r *FullscreenRenderer) RefreshWindows(windows []Window) {}
|
|
|
|
func (r *FullscreenRenderer) NewWindow(top int, left int, width int, height int, preview bool, borderStyle BorderStyle) Window {
|
|
return nil
|
|
}
|