Fix this properly...

This commit is contained in:
Nicholas Marriott 2009-01-23 20:17:04 +00:00
parent 374b0d85b8
commit 2cbd21ea44

View File

@ -1,4 +1,4 @@
/* $Id: window-choose.c,v 1.4 2009-01-23 17:14:30 nicm Exp $ */ /* $Id: window-choose.c,v 1.5 2009-01-23 20:17:04 nicm Exp $ */
/* /*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -231,8 +231,12 @@ window_choose_key(struct window_pane *wp, unused struct client *c, int key)
if (data->selected > items - 1) if (data->selected > items - 1)
data->selected = items - 1; 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) 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); data->top = items - screen_size_y(s);
}
window_choose_redraw_screen(wp); window_choose_redraw_screen(wp);
break; break;
default: default: