mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-01 20:52:06 -07:00
Revert "Prefer LightRenderer on Windows if it's available"
This reverts commit 7915e365b3
due to https://github.com/junegunn/fzf.vim/issues/1152#issuecomment-719696495.
This commit is contained in:
@@ -408,11 +408,11 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
|
|||||||
var renderer tui.Renderer
|
var renderer tui.Renderer
|
||||||
fullscreen := opts.Height.size == 0 || opts.Height.percent && opts.Height.size == 100
|
fullscreen := opts.Height.size == 0 || opts.Height.percent && opts.Height.size == 100
|
||||||
if fullscreen {
|
if fullscreen {
|
||||||
if tui.IsLightRendererSupported() {
|
if tui.HasFullscreenRenderer() {
|
||||||
|
renderer = tui.NewFullscreenRenderer(opts.Theme, opts.Black, opts.Mouse)
|
||||||
|
} else {
|
||||||
renderer = tui.NewLightRenderer(opts.Theme, opts.Black, opts.Mouse, opts.Tabstop, opts.ClearOnExit,
|
renderer = tui.NewLightRenderer(opts.Theme, opts.Black, opts.Mouse, opts.Tabstop, opts.ClearOnExit,
|
||||||
true, func(h int) int { return h })
|
true, func(h int) int { return h })
|
||||||
} else {
|
|
||||||
renderer = tui.NewFullscreenRenderer(opts.Theme, opts.Black, opts.Mouse)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
maxHeightFunc := func(termHeight int) int {
|
maxHeightFunc := func(termHeight int) int {
|
||||||
|
@@ -6,6 +6,10 @@ package tui
|
|||||||
|
|
||||||
type Attr int
|
type Attr int
|
||||||
|
|
||||||
|
func HasFullscreenRenderer() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (a Attr) Merge(b Attr) Attr {
|
func (a Attr) Merge(b Attr) Attr {
|
||||||
return a | b
|
return a | b
|
||||||
}
|
}
|
||||||
|
@@ -15,6 +15,10 @@ import (
|
|||||||
"github.com/mattn/go-runewidth"
|
"github.com/mattn/go-runewidth"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func HasFullscreenRenderer() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (p ColorPair) style() tcell.Style {
|
func (p ColorPair) style() tcell.Style {
|
||||||
style := tcell.StyleDefault
|
style := tcell.StyleDefault
|
||||||
return style.Foreground(tcell.Color(p.Fg())).Background(tcell.Color(p.Bg()))
|
return style.Foreground(tcell.Color(p.Fg())).Background(tcell.Color(p.Bg()))
|
||||||
|
Reference in New Issue
Block a user