mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-24 07:38:36 +00:00
Minor refactoring tcell library from tui.go to tcell.go
To prevent including tcell library in non-windows builds.
This commit is contained in:
parent
0ff885461b
commit
b8aa2d2c32
@ -120,8 +120,11 @@ func (a Attr) Merge(b Attr) Attr {
|
|||||||
return a | b
|
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 (
|
var (
|
||||||
_screen tcell.Screen
|
_screen tcell.Screen
|
||||||
|
_prevMouseButton tcell.ButtonMask
|
||||||
)
|
)
|
||||||
|
|
||||||
func (r *FullscreenRenderer) initScreen() {
|
func (r *FullscreenRenderer) initScreen() {
|
||||||
@ -193,8 +196,8 @@ func (r *FullscreenRenderer) GetChar() Event {
|
|||||||
mod := ev.Modifiers() != 0
|
mod := ev.Modifiers() != 0
|
||||||
|
|
||||||
// since we dont have mouse down events (unlike LightRenderer), we need to track state in prevButton
|
// since we dont have mouse down events (unlike LightRenderer), we need to track state in prevButton
|
||||||
prevButton, button := r.prevMouseButton, ev.Buttons()
|
prevButton, button := _prevMouseButton, ev.Buttons()
|
||||||
r.prevMouseButton = button
|
_prevMouseButton = button
|
||||||
drag := prevButton == button
|
drag := prevButton == button
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
@ -5,8 +5,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gdamore/tcell"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Types of user action
|
// Types of user action
|
||||||
@ -403,7 +401,6 @@ type FullscreenRenderer struct {
|
|||||||
mouse bool
|
mouse bool
|
||||||
forceBlack bool
|
forceBlack bool
|
||||||
prevDownTime time.Time
|
prevDownTime time.Time
|
||||||
prevMouseButton tcell.ButtonMask
|
|
||||||
clickY []int
|
clickY []int
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +410,6 @@ func NewFullscreenRenderer(theme *ColorTheme, forceBlack bool, mouse bool) Rende
|
|||||||
mouse: mouse,
|
mouse: mouse,
|
||||||
forceBlack: forceBlack,
|
forceBlack: forceBlack,
|
||||||
prevDownTime: time.Unix(0, 0),
|
prevDownTime: time.Unix(0, 0),
|
||||||
prevMouseButton: tcell.ButtonNone,
|
|
||||||
clickY: []int{}}
|
clickY: []int{}}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user