Disable mouse drag events (#962)

This fixes an issue where mouse bindings would be repeated when clicking
and dragging.
This commit is contained in:
Paul Ouellette authored and GitHub committed 2022-10-15 16:10:44 +03:00
1 parent 8b11ffd698
commit 747aff8763
1 file changed
+4 -2
+4 -2
View File
@@ -10,6 +10,8 @@ import (
"time"
"unicode"
"unicode/utf8"
"github.com/gdamore/tcell/v2"
)
func (e *setExpr) eval(app *app, args []string) {
@@ -181,7 +183,7 @@ func (e *setExpr) eval(app *app, args []string) {
case "mouse":
if !gOpts.mouse {
gOpts.mouse = true
app.ui.screen.EnableMouse()
app.ui.screen.EnableMouse(tcell.MouseButtonEvents)
}
case "nomouse":
if gOpts.mouse {
@@ -194,7 +196,7 @@ func (e *setExpr) eval(app *app, args []string) {
app.ui.screen.DisableMouse()
} else {
gOpts.mouse = true
app.ui.screen.EnableMouse()
app.ui.screen.EnableMouse(tcell.MouseButtonEvents)
}
case "number":
gOpts.number = true