]> git.mdlowis.com Git - projs/tide.git/commitdiff
Fixed a bug where successive right clicks erroneously expand search selection
authorMichael D. Lowis <mike@mdlowis.com>
Mon, 24 Oct 2016 22:48:38 +0000 (18:48 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Mon, 24 Oct 2016 22:48:38 +0000 (18:48 -0400)
mouse.c

diff --git a/mouse.c b/mouse.c
index 63af1366449a846450b4c8a6c29e2cd052d43d7c..1cceaa451c82db7a4390bc29127d63bdc5d280d5 100644 (file)
--- a/mouse.c
+++ b/mouse.c
@@ -48,8 +48,8 @@ void selection(MouseEvent* mevnt) {
 }
 
 void search(MouseEvent* mevnt) {
-    unsigned clickpos = screen_getoff(&Buffer, DotEnd, mevnt->y, mevnt->x);
-    if (DotBeg == DotEnd || clickpos < DotBeg || clickpos > DotEnd) {
+    unsigned clickpos = screen_getoff(&Buffer, DotEnd, mevnt->y-1, mevnt->x);
+    if (clickpos < DotBeg || clickpos > DotEnd) {
         move_cursor(mevnt);
         selection(mevnt);
     }
@@ -96,8 +96,8 @@ void (*Actions[5][3])(MouseEvent* mevnt) = {
     },
     [MOUSE_RIGHT] = {
         [SINGLE_CLICK] = search,
-        [DOUBLE_CLICK] = unused,
-        [TRIPLE_CLICK] = unused,
+        [DOUBLE_CLICK] = search,
+        [TRIPLE_CLICK] = search,
     },
     [MOUSE_WHEELUP] = {
         [SINGLE_CLICK] = scrollup,