diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2014-04-17 14:14:00 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2014-04-17 14:14:00 +0000 |
commit | bc13a6675fb62d25b9518af091670b9c624bb6db (patch) | |
tree | e553d0a1e93d6eb318e917c6b6a34322a7234848 /usr.bin/tmux/window-choose.c | |
parent | e2471198007948c9a61a0a39620a17d682fc8160 (diff) |
Only scroll by one line at a time in choose mode, lists are generally
pretty small.
Diffstat (limited to 'usr.bin/tmux/window-choose.c')
-rw-r--r-- | usr.bin/tmux/window-choose.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/usr.bin/tmux/window-choose.c b/usr.bin/tmux/window-choose.c index 5b5e2a2bc27..f36ae13d143 100644 --- a/usr.bin/tmux/window-choose.c +++ b/usr.bin/tmux/window-choose.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-choose.c,v 1.52 2014/04/03 08:20:29 nicm Exp $ */ +/* $OpenBSD: window-choose.c,v 1.53 2014/04/17 14:13:59 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -715,21 +715,23 @@ window_choose_key(struct window_pane *wp, unused struct session *sess, int key) } void -window_choose_mouse( - struct window_pane *wp, unused struct session *sess, struct mouse_event *m) +window_choose_mouse(struct window_pane *wp, struct session *sess, + struct mouse_event *m) { struct window_choose_mode_data *data = wp->modedata; struct screen *s = &data->screen; struct window_choose_mode_item *item; - u_int i, idx; + u_int idx; if (m->event == MOUSE_EVENT_WHEEL) { - for (i = 0; i < m->scroll; i++) { - if (m->wheel == MOUSE_WHEEL_UP) - window_choose_key(wp, sess, KEYC_UP); - else - window_choose_key(wp, sess, KEYC_DOWN); - } + /* + * Don't use m->scroll and just move line-by-line or it's + * annoying. + */ + if (m->wheel == MOUSE_WHEEL_UP) + window_choose_key(wp, sess, KEYC_UP); + else + window_choose_key(wp, sess, KEYC_DOWN); return; } |