mirror of
https://github.com/tmux/tmux.git
synced 2025-01-13 03:48:51 +00:00
Fix next/previous page. DOH.
This commit is contained in:
parent
4d9af27b0b
commit
374b0d85b8
@ -1,4 +1,4 @@
|
|||||||
/* $Id: window-choose.c,v 1.3 2009-01-18 17:20:52 nicm Exp $ */
|
/* $Id: window-choose.c,v 1.4 2009-01-23 17:14:30 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -193,7 +193,6 @@ window_choose_key(struct window_pane *wp, unused struct client *c, int key)
|
|||||||
break;
|
break;
|
||||||
if (data->selected == items - 1) {
|
if (data->selected == items - 1) {
|
||||||
data->selected = 0;
|
data->selected = 0;
|
||||||
if (data->top != 0)
|
|
||||||
data->top = 0;
|
data->top = 0;
|
||||||
window_choose_redraw_screen(wp);
|
window_choose_redraw_screen(wp);
|
||||||
break;
|
break;
|
||||||
@ -211,10 +210,16 @@ window_choose_key(struct window_pane *wp, unused struct client *c, int key)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MODEKEY_PPAGE:
|
case MODEKEY_PPAGE:
|
||||||
|
if (data->selected < screen_size_y(s)) {
|
||||||
|
data->selected = 0;
|
||||||
|
data->top = 0;
|
||||||
|
} else {
|
||||||
|
data->selected -= screen_size_y(s);
|
||||||
if (data->top < screen_size_y(s))
|
if (data->top < screen_size_y(s))
|
||||||
data->top = 0;
|
data->top = 0;
|
||||||
else
|
else
|
||||||
data->top -= screen_size_y(s);
|
data->top -= screen_size_y(s);
|
||||||
|
}
|
||||||
window_choose_redraw_screen(wp);
|
window_choose_redraw_screen(wp);
|
||||||
break;
|
break;
|
||||||
case MODEKEY_NONE:
|
case MODEKEY_NONE:
|
||||||
@ -222,10 +227,12 @@ window_choose_key(struct window_pane *wp, unused struct client *c, int key)
|
|||||||
break;
|
break;
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case MODEKEY_NPAGE:
|
case MODEKEY_NPAGE:
|
||||||
if (data->top + screen_size_y(s) > ARRAY_LENGTH(&data->list))
|
data->selected += screen_size_y(s);
|
||||||
data->top = ARRAY_LENGTH(&data->list);
|
if (data->selected > items - 1)
|
||||||
else
|
data->selected = items - 1;
|
||||||
data->top += screen_size_y(s);
|
data->top += screen_size_y(s);
|
||||||
|
if (data->top + screen_size_y(s) - 1 > data->selected)
|
||||||
|
data->top = items - screen_size_y(s);
|
||||||
window_choose_redraw_screen(wp);
|
window_choose_redraw_screen(wp);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user