mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-05-31 22:50:49 +00:00
d8188fce7b
Close #3228 * Works inside and outside of tmux * There is a problem where fzf unnecessarily displays the scroll offset indicator at the topbright of the screen when the image just fits the preview window. This is because `kitty icat` generates an extra line after the image area. # A 5-row images; an extra row at the end confuses fzf ["\e_Ga ... \e[9C̅̅ࠪ̅̍ࠪ̅̎ࠪ̅̐ࠪ̅̒ࠪ̅̽ࠪ̅̾ࠪ̅̿ࠪ̅͆ࠪ̅͊ࠪ̅͋ࠪ\n", "\r\e[9C̍̅ࠪ̍̍ࠪ̍̎ࠪ̍̐ࠪ̍̒ࠪ̍̽ࠪ̍̾ࠪ̍̿ࠪ̍͆ࠪ̍͊ࠪ̍͋ࠪ\n", "\r\e[9C̎̅ࠪ̎̍ࠪ̎̎ࠪ̎̐ࠪ̎̒ࠪ̎̽ࠪ̎̾ࠪ̎̿ࠪ̎͆ࠪ̎͊ࠪ̎͋ࠪ\n", "\r\e[9C̐̅ࠪ̐̍ࠪ̐̎ࠪ̐̐ࠪ̐̒ࠪ̐̽ࠪ̐̾ࠪ̐̿ࠪ̐͆ࠪ̐͊ࠪ̐͋ࠪ\n", "\r\e[9C̒̅ࠪ̒̍ࠪ̒̎ࠪ̒̐ࠪ̒̒ࠪ̒̽ࠪ̒̾ࠪ̒̿ࠪ̒͆ࠪ̒͊ࠪ̒͋ࠪ\n", "\r\e[39m\e8"] * Example: fzf --preview=' if file --mime-type {} | grep -qF 'image/'; then # --transfer-mode=memory is the fastest option but if you want fzf to be able # to redraw the image on terminal resize or on 'change-preview-window', # you need to use --transfer-mode=stream. kitty icat --clear --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {} else bat --color=always {} fi '
51 lines
1.5 KiB
Go
51 lines
1.5 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) 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
|
|
}
|