diff --git a/cmd/micro/actions.go b/cmd/micro/actions.go index 732459b0..d5d52065 100644 --- a/cmd/micro/actions.go +++ b/cmd/micro/actions.go @@ -78,7 +78,7 @@ func (v *View) MousePress(usePlugin bool, e *tcell.EventMouse) bool { v.Cursor.ResetSelection() v.Relocate() } - if time.Since(v.lastClickTime)/time.Millisecond < doubleClickThreshold { + if time.Since(v.lastClickTime)/time.Millisecond < doubleClickThreshold && (x == v.lastLoc.X && y == v.lastLoc.Y) { if v.doubleClick { // Triple click v.lastClickTime = time.Now() @@ -119,6 +119,8 @@ func (v *View) MousePress(usePlugin bool, e *tcell.EventMouse) bool { } } + v.lastLoc = Loc{x, y} + if usePlugin { PostActionCall("MousePress", v, e) } diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 4560c30e..b30e6e60 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -73,6 +73,7 @@ type View struct { // This stores when the last click was // This is useful for detecting double and triple clicks lastClickTime time.Time + lastLoc Loc // lastCutTime stores when the last ctrl+k was issued. // It is used for clearing the clipboard to replace it with fresh cut lines.