Skip to content

Commit

Permalink
Disable mouse drag events (#962)
Browse files Browse the repository at this point in the history
This fixes an issue where mouse bindings would be repeated when clicking
and dragging.
  • Loading branch information
p-ouellette committed Oct 15, 2022
1 parent 8b11ffd commit 747aff8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"time"
"unicode"
"unicode/utf8"

"github.com/gdamore/tcell/v2"
)

func (e *setExpr) eval(app *app, args []string) {
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 747aff8

Please sign in to comment.