summaryrefslogtreecommitdiff
path: root/src/tui/tui.go
diff options
context:
space:
mode:
authorVlastimil Ovčáčík <vovcacik@github.ovcacik.org>2021-09-21 17:52:39 +0200
committerJunegunn Choi <junegunn.c@gmail.com>2021-10-03 01:39:30 +0900
commit0ff885461b0474b58f08d7c3f48992a0e1eafee0 (patch)
tree730a1209b4c5af4ac8233f15370fc8ea857722f9 /src/tui/tui.go
parentca43f95fb1835f74f837e1599a3383b4a7123390 (diff)
downloadfzf-0ff885461b0474b58f08d7c3f48992a0e1eafee0.tar.gz
Add mouse support to the FullscreenRenderer
Diffstat (limited to 'src/tui/tui.go')
-rw-r--r--src/tui/tui.go24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/tui/tui.go b/src/tui/tui.go
index eb09da40..12359c62 100644
--- a/src/tui/tui.go
+++ b/src/tui/tui.go
@@ -5,6 +5,8 @@ import (
"os"
"strconv"
"time"
+
+ "github.com/gdamore/tcell"
)
// Types of user action
@@ -397,20 +399,22 @@ type Window interface {
}
type FullscreenRenderer struct {
- theme *ColorTheme
- mouse bool
- forceBlack bool
- prevDownTime time.Time
- clickY []int
+ theme *ColorTheme
+ mouse bool
+ forceBlack bool
+ prevDownTime time.Time
+ prevMouseButton tcell.ButtonMask
+ clickY []int
}
func NewFullscreenRenderer(theme *ColorTheme, forceBlack bool, mouse bool) Renderer {
r := &FullscreenRenderer{
- theme: theme,
- mouse: mouse,
- forceBlack: forceBlack,
- prevDownTime: time.Unix(0, 0),
- clickY: []int{}}
+ theme: theme,
+ mouse: mouse,
+ forceBlack: forceBlack,
+ prevDownTime: time.Unix(0, 0),
+ prevMouseButton: tcell.ButtonNone,
+ clickY: []int{}}
return r
}