Skip to content

Commit

Permalink
Revert "Prefer LightRenderer on Windows if it's available"
Browse files Browse the repository at this point in the history
This reverts commit 7915e36
due to junegunn/fzf.vim#1152 (comment).
  • Loading branch information
junegunn authored and kralicky committed Jun 23, 2021
1 parent 4f70272 commit 529927e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,11 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
var renderer tui.Renderer
fullscreen := opts.Height.size == 0 || opts.Height.percent && opts.Height.size == 100
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,
true, func(h int) int { return h })
} else {
renderer = tui.NewFullscreenRenderer(opts.Theme, opts.Black, opts.Mouse)
}
} else {
maxHeightFunc := func(termHeight int) int {
Expand Down
4 changes: 4 additions & 0 deletions src/tui/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ package tui

type Attr int

func HasFullscreenRenderer() bool {
return false
}

func (a Attr) Merge(b Attr) Attr {
return a | b
}
Expand Down
4 changes: 4 additions & 0 deletions src/tui/tcell.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/mattn/go-runewidth"
)

func HasFullscreenRenderer() bool {
return true
}

func (p ColorPair) style() tcell.Style {
style := tcell.StyleDefault
return style.Foreground(tcell.Color(p.Fg())).Background(tcell.Color(p.Bg()))
Expand Down

0 comments on commit 529927e

Please sign in to comment.