summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-03-02 17:01:00 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-03-02 17:01:00 +0000
commit5803c4fc5bc306eee11ed95971829108a9f5616a (patch)
tree10f504ab3795ca8be0b7f85dea9b310afb86228f
parent57f5f44d0f55136a78f511bb74b92e2ccbf6f309 (diff)
Fix window choice mode, again.
-rw-r--r--TODO2
-rw-r--r--window-choose.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/TODO b/TODO
index 50f21531..37d2f0d2 100644
--- a/TODO
+++ b/TODO
@@ -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
diff --git a/window-choose.c b/window-choose.c
index 44cec858..1d1876a6 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -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: