Only scroll by one line at a time in choose mode, lists are generally

pretty small.
This commit is contained in:
nicm 2014-04-17 14:13:59 +00:00
parent 3e27be353d
commit f194f103a2

View File

@ -715,21 +715,23 @@ window_choose_key(struct window_pane *wp, unused struct session *sess, int key)
} }
void void
window_choose_mouse( window_choose_mouse(struct window_pane *wp, struct session *sess,
struct window_pane *wp, unused struct session *sess, struct mouse_event *m) struct mouse_event *m)
{ {
struct window_choose_mode_data *data = wp->modedata; struct window_choose_mode_data *data = wp->modedata;
struct screen *s = &data->screen; struct screen *s = &data->screen;
struct window_choose_mode_item *item; struct window_choose_mode_item *item;
u_int i, idx; u_int idx;
if (m->event == MOUSE_EVENT_WHEEL) { if (m->event == MOUSE_EVENT_WHEEL) {
for (i = 0; i < m->scroll; i++) { /*
* Don't use m->scroll and just move line-by-line or it's
* annoying.
*/
if (m->wheel == MOUSE_WHEEL_UP) if (m->wheel == MOUSE_WHEEL_UP)
window_choose_key(wp, sess, KEYC_UP); window_choose_key(wp, sess, KEYC_UP);
else else
window_choose_key(wp, sess, KEYC_DOWN); window_choose_key(wp, sess, KEYC_DOWN);
}
return; return;
} }