Krolyxon
Commit edd0169

Branches

Refs →

nsxivedd0169

Fixed it_scroll_move(DIR_DOWN) in thumb mode for last line

Author
Bert Münnich
Date
2012-03-16 20:56 +0100
Parent
d7ff54b
Commit
edd016945a5a3d8a742dae65cec5025bd5e508be

+11 −9

2 files changed

  1. M Makefile +1 −1
  2. M thumbs.c +10 −8
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20120313
1+VERSION = git-20120316
22
33 CC = gcc
44 CFLAGS = -ansi -Wall -pedantic -O2
M thumbs.c View
@@ -399,14 +399,6 @@ bool tns_move_selection(tns_t *tns, direction_t dir) {
399399 old = tns->sel;
400400
401401 switch (dir) {
402− case DIR_LEFT:
403− if (tns->sel > 0)
404− tns->sel--;
405− break;
406− case DIR_RIGHT:
407− if (tns->sel < tns->cnt - 1)
408− tns->sel++;
409− break;
410402 case DIR_UP:
411403 if (tns->sel >= tns->cols)
412404 tns->sel -= tns->cols;
@@ -414,6 +406,16 @@ bool tns_move_selection(tns_t *tns, direction_t dir) {
414406 case DIR_DOWN:
415407 if (tns->sel + tns->cols < tns->cnt)
416408 tns->sel += tns->cols;
409+ else if (tns->sel < tns->cnt - tns->cnt % tns->cols)
410+ tns->sel = tns->cnt - 1;
411+ break;
412+ case DIR_LEFT:
413+ if (tns->sel > 0)
414+ tns->sel--;
415+ break;
416+ case DIR_RIGHT:
417+ if (tns->sel < tns->cnt - 1)
418+ tns->sel++;
417419 break;
418420 }
419421