2015-07-28 17:50:35 (UTC-03:00)
Marcel Rodrigues <marcelgmr@gmail.com>
Ensure selection is not negative.
diff --git a/rover.c b/rover.c index dd127a6..a95eee4 100644 --- a/rover.c +++ b/rover.c @@ -367,7 +367,7 @@ update_view() mvaddnwstr(0, 0, WBUF, COLS - 4 - numsize); wcolor_set(rover.window, RVC_BORDER, NULL); wborder(rover.window, 0, 0, 0, 0, 0, 0, 0, 0); - ESEL = MIN(ESEL, rover.nfiles - 1); + ESEL = MAX(MIN(ESEL, rover.nfiles - 1), 0); /* Selection might not be visible, due to cursor wrapping or window shrinking. In that case, the scroll must be moved to make it visible. */ SCROLL = MAX(MIN(SCROLL, ESEL), ESEL - HEIGHT + 1);