Remove unnecessary check for selection

This commit is contained in:
Zachary Yedidia 2016-04-30 16:56:48 -04:00
parent 539d4b1167
commit 012668146c

View file

@ -278,12 +278,9 @@ func (v *View) HandleEvent(event tcell.Event) {
switch button { switch button {
case tcell.Button1: case tcell.Button1:
// Left click // Left click
origX, origY := v.cursor.x, v.cursor.y
if v.mouseReleased && !e.HasMotion() { if v.mouseReleased && !e.HasMotion() {
v.MoveToMouseClick(x, y) v.MoveToMouseClick(x, y)
if (time.Since(v.lastClickTime)/time.Millisecond < doubleClickThreshold) && if time.Since(v.lastClickTime)/time.Millisecond < doubleClickThreshold {
(origX == v.cursor.x && origY == v.cursor.y) {
if v.doubleClick { if v.doubleClick {
// Triple click // Triple click
v.lastClickTime = time.Now() v.lastClickTime = time.Now()