From edd016945a5a3d8a742dae65cec5025bd5e508be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Fri, 16 Mar 2012 20:56:10 +0100 Subject: Fixed it_scroll_move(DIR_DOWN) in thumb mode for last line --- thumbs.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'thumbs.c') diff --git a/thumbs.c b/thumbs.c index cd8d315..9e49ca4 100644 --- a/thumbs.c +++ b/thumbs.c @@ -399,14 +399,6 @@ bool tns_move_selection(tns_t *tns, direction_t dir) { old = tns->sel; switch (dir) { - case DIR_LEFT: - if (tns->sel > 0) - tns->sel--; - break; - case DIR_RIGHT: - if (tns->sel < tns->cnt - 1) - tns->sel++; - break; case DIR_UP: if (tns->sel >= tns->cols) tns->sel -= tns->cols; @@ -414,6 +406,16 @@ bool tns_move_selection(tns_t *tns, direction_t dir) { case DIR_DOWN: if (tns->sel + tns->cols < tns->cnt) tns->sel += tns->cols; + else if (tns->sel < tns->cnt - tns->cnt % tns->cols) + tns->sel = tns->cnt - 1; + break; + case DIR_LEFT: + if (tns->sel > 0) + tns->sel--; + break; + case DIR_RIGHT: + if (tns->sel < tns->cnt - 1) + tns->sel++; break; } -- cgit v1.2.3