> +                     if (m->wheel == MOUSE_WHEEL_UP) {
> +                             if (data->selected != data->top)
> +                                     window_choose_key(wp, sess, KEYC_UP);
> +                     }
That obviously fails for more than a screenful of choices. Correction
attached.
#Regards.
>From 419a8102b6308477f62c54278eab77d034c8e8d3 Mon Sep 17 00:00:00 2001
From: Marcel Partap <mpar...@gmx.net>
Date: Sun, 13 Apr 2014 00:31:10 +0200
Subject: [PATCH 1/2] Don't wrap mouse scrolling in choice-mode lists v2

Feels somewhat more natural. Objections?
---
 window-choose.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/window-choose.c b/window-choose.c
index 9406b9c..7ecab32 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -726,10 +726,13 @@ window_choose_mouse(
 	if (m->event == MOUSE_EVENT_WHEEL) {
 		/* Fine-grained scrolling in choice-mode. */
 		for (i = 0; i < (m->scroll > 3 ? m->scroll/3 : 1); i++) {
-			if (m->wheel == MOUSE_WHEEL_UP)
-				window_choose_key(wp, sess, KEYC_UP);
+			if (m->wheel == MOUSE_WHEEL_UP) {
+				if (data->selected > 0)
+					window_choose_key(wp, sess, KEYC_UP);
+			}
 			else
-				window_choose_key(wp, sess, KEYC_DOWN);
+				if(data->selected < ARRAY_LENGTH(&data->list) - 1)
+					window_choose_key(wp, sess, KEYC_DOWN);
 		}
 		return;
 	}
-- 
1.9.2

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to