Fix page down, again.

This commit is contained in:
Nicholas Marriott 2009-01-29 20:02:33 +00:00
parent 2bf9f4973b
commit b4076865bb
2 changed files with 5 additions and 8 deletions

1
TODO
View File

@ -90,4 +90,3 @@
- document find-window
- document split-window -p and -l
- attach should have a flag to create session if it doesn't exist
- fix page up/down in choice mode AGAIN

View File

@ -1,4 +1,4 @@
/* $Id: window-choose.c,v 1.9 2009-01-28 22:00:22 nicm Exp $ */
/* $Id: window-choose.c,v 1.10 2009-01-29 20:02:33 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -235,12 +235,10 @@ window_choose_key(struct window_pane *wp, unused struct client *c, int key)
if (data->selected > items - 1)
data->selected = items - 1;
data->top += screen_size_y(s);
if (data->top + screen_size_y(s) - 1 > data->selected) {
if (items < screen_size_y(s) - 1)
data->top = 0;
else
data->top = items - screen_size_y(s);
}
if (data->selected < data->top)
data->top = data->selected;
if (data->top + screen_size_y(s) > items)
data->top = items - screen_size_y(s);
window_choose_redraw_screen(wp);
break;
default: