Fix window choice mode, again.

This commit is contained in:
Nicholas Marriott 2009-03-02 17:01:00 +00:00
parent 57f5f44d0f
commit 5803c4fc5b
2 changed files with 6 additions and 5 deletions

2
TODO
View File

@ -91,8 +91,6 @@
- test bug sshing from freebsd console
- better support for stupid margin terminals. strcmp for cons25 sucks, how can
these be autodetected?
- the escape timer for M- is too short for escape+key. fiddle with it
- page up/down in choose mode is STILL broken. damn
- set-option should be set-session-option and should be overall global options
for stuff like mode keys?
- document status-keys

View File

@ -1,4 +1,4 @@
/* $Id: window-choose.c,v 1.12 2009-02-21 17:46:13 nicm Exp $ */
/* $Id: window-choose.c,v 1.13 2009-03-02 17:01:00 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -237,10 +237,13 @@ 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 (screen_size_y(s) < items) {
if (data->top + screen_size_y(s) > items)
data->top = items - screen_size_y(s);
} else
data->top = 0;
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: