From 15dbf37154372c4aa15fbda1b6319fb81109209d Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Fri, 22 Apr 2016 09:11:44 -0400 Subject: [PATCH] Possible fix for elementary mouse issue --- cmd/micro/view.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 939b5e91..35264beb 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -528,7 +528,7 @@ func (v *View) HandleEvent(event tcell.Event) { origX, origY := v.cursor.x, v.cursor.y v.MoveToMouseClick(x, y) - if v.mouseReleased { + if v.mouseReleased && !e.HasMotion() { if (time.Since(v.lastClickTime)/time.Millisecond < doubleClickThreshold) && (origX == v.cursor.x && origY == v.cursor.y) { if v.doubleClick { @@ -557,6 +557,7 @@ func (v *View) HandleEvent(event tcell.Event) { v.cursor.curSelection[0] = loc v.cursor.curSelection[1] = loc } + v.mouseReleased = false } else { if v.tripleClick { v.cursor.AddLineToSelection() @@ -566,7 +567,6 @@ func (v *View) HandleEvent(event tcell.Event) { v.cursor.curSelection[1] = v.cursor.Loc() } } - v.mouseReleased = false case tcell.ButtonNone: // Mouse event with no click if !v.mouseReleased {