summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2193aa8)
raw | patch | inline | side by side (parent: 2193aa8)
author | Max Kellermann <max@duempel.org> | |
Tue, 25 Nov 2008 17:44:42 +0000 (18:44 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 25 Nov 2008 17:44:42 +0000 (18:44 +0100) |
Due to a side effect of the old "if" condition, the cursor was never
reset to the origin when the list was cleared.
reset to the origin when the list was cleared.
src/list_window.c | patch | blob | history |
diff --git a/src/list_window.c b/src/list_window.c
index efb610117231d92812c8654b7234ebcb54ad0484..9f34f539fc6d212dfcfdff9643611128bab8238a 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
if (lw->selected < lw->start)
lw->selected = lw->start;
- if (length > 0 && lw->selected >= length)
+ if (length == 0)
+ lw->selected = 0;
+ else if (lw->selected >= length)
lw->selected = length - 1;
}