Krolyxon
Commit 71a7940

Branches

Refs →

nsxiv71a7940

Better fix for issue #25

Author
Bert Münnich
Date
2011-11-01 08:36 +0100
Parent
964bf13
Commit
71a7940d74459c8a575100f93fe43e204413c2db

+7 −7

3 files changed

  1. M Makefile +1 −1
  2. M commands.c +1 −4
  3. M main.c +5 −2
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = 1.0
1+VERSION = git-20111101
22
33 CC = gcc
44 CFLAGS = -ansi -Wall -pedantic -O2
M commands.c View
@@ -69,10 +69,7 @@ bool it_switch_mode(arg_t a) {
6969 img.slideshow = false;
7070 reset_timeout(slideshow);
7171 }
72− if (fileidx < tns.cnt)
73− tns.sel = fileidx;
74− else
75− tns.sel = tns.cnt > 0 ? tns.cnt - 1 : 0;
72+ tns.sel = fileidx;
7673 tns.dirty = true;
7774 mode = MODE_THUMB;
7875 } else {
M main.c View
@@ -416,10 +416,13 @@ void run(void) {
416416 {
417417 /* load thumbnails */
418418 set_timeout(redraw, TO_REDRAW_THUMBS, false);
419− if (tns_load(&tns, tns.cnt, &files[tns.cnt], false, false))
419+ if (tns_load(&tns, tns.cnt, &files[tns.cnt], false, false)) {
420420 tns.cnt++;
421− else
421+ } else {
422422 remove_file(tns.cnt, false);
423+ if (tns.sel >= tns.cnt)
424+ tns.sel--;
425+ }
423426 if (tns.cnt == filecnt)
424427 redraw();
425428 else