aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Münnich <be.muennich@googlemail.com>2012-03-16 20:56:10 +0100
committerBert Münnich <be.muennich@googlemail.com>2012-03-16 20:56:10 +0100
commitedd016945a5a3d8a742dae65cec5025bd5e508be (patch)
tree5e3d6139ae7121332ad908141bfd9eb02575befa
parentd7ff54bb6efc3dbaa2e524a141b423f894bcbc98 (diff)
Fixed it_scroll_move(DIR_DOWN) in thumb mode for last line
-rw-r--r--Makefile2
-rw-r--r--thumbs.c18
2 files changed, 11 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index e89a309..2000e8d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = git-20120313
+VERSION = git-20120316
CC = gcc
CFLAGS = -ansi -Wall -pedantic -O2
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;
}