From 747aff876326bb252afc2c3fd6df23060a3a610e Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Sat, 15 Oct 2022 08:10:44 -0500 Subject: [PATCH] Disable mouse drag events (#962) This fixes an issue where mouse bindings would be repeated when clicking and dragging. --- eval.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eval.go b/eval.go index 9e230071..c8c9cac7 100644 --- a/eval.go +++ b/eval.go @@ -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