mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-07 16:30:58 +00:00
Fix elementary mouse issue
Fixes #34 This commit requires a modification to tcell before it will work.
This commit is contained in:
parent
15dbf37154
commit
3d76898afe
1 changed files with 3 additions and 2 deletions
|
|
@ -526,9 +526,9 @@ func (v *View) HandleEvent(event tcell.Event) {
|
|||
case tcell.Button1:
|
||||
// Left click
|
||||
origX, origY := v.cursor.x, v.cursor.y
|
||||
v.MoveToMouseClick(x, y)
|
||||
|
||||
if v.mouseReleased && !e.HasMotion() {
|
||||
v.MoveToMouseClick(x, y)
|
||||
if (time.Since(v.lastClickTime)/time.Millisecond < doubleClickThreshold) &&
|
||||
(origX == v.cursor.x && origY == v.cursor.y) {
|
||||
if v.doubleClick {
|
||||
|
|
@ -558,7 +558,8 @@ func (v *View) HandleEvent(event tcell.Event) {
|
|||
v.cursor.curSelection[1] = loc
|
||||
}
|
||||
v.mouseReleased = false
|
||||
} else {
|
||||
} else if !v.mouseReleased {
|
||||
v.MoveToMouseClick(x, y)
|
||||
if v.tripleClick {
|
||||
v.cursor.AddLineToSelection()
|
||||
} else if v.doubleClick {
|
||||
|
|
|
|||
Loading…
Reference in a new issue