Permalink
Browse files

Fixed it_scroll_move(DIR_DOWN) in thumb mode for last line

  • Loading branch information...
1 parent d7ff54b commit edd016945a5a3d8a742dae65cec5025bd5e508be @muennich committed Mar 16, 2012
Showing with 11 additions and 9 deletions.
  1. +1 −1 Makefile
  2. +10 −8 thumbs.c
View
2 Makefile
@@ -1,4 +1,4 @@
-VERSION = git-20120313
+VERSION = git-20120316
CC = gcc
CFLAGS = -ansi -Wall -pedantic -O2
View
18 thumbs.c
@@ -399,21 +399,23 @@ 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;
break;
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;
}

0 comments on commit edd0169

Please sign in to comment.