Minor refactoring tcell library from tui.go to tcell.go

To prevent including tcell library in non-windows builds.
This commit is contained in:
Vlastimil Ovčáčík authored and Junegunn Choi committed 2021-10-03 01:39:30 +09:00
1 parent 0ff885461b
commit b8aa2d2c32
2 files changed
+16 -17

No files matched your search

+6 -3
View File
@@ -120,8 +120,11 @@ func (a Attr) Merge(b Attr) Attr {
return a | b
}
// handle the following as private members of FullscreenRenderer instance
// they are declared here to prevent introducing tcell library in non-windows builds
var (
_screen tcell.Screen
_screen tcell.Screen
_prevMouseButton tcell.ButtonMask
)
func (r *FullscreenRenderer) initScreen() {
@@ -193,8 +196,8 @@ func (r *FullscreenRenderer) GetChar() Event {
mod := ev.Modifiers() != 0
// since we dont have mouse down events (unlike LightRenderer), we need to track state in prevButton
prevButton, button := r.prevMouseButton, ev.Buttons()
r.prevMouseButton = button
prevButton, button := _prevMouseButton, ev.Buttons()
_prevMouseButton = button
drag := prevButton == button
switch {