summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBert Münnich <ber.t@gmx.com>2011-11-01 08:36:20 +0100
committerBert Münnich <ber.t@gmx.com>2011-11-01 08:36:20 +0100
commit71a7940d74459c8a575100f93fe43e204413c2db (patch)
tree6262f06a148de8899ef1ecbd9cd947538f78bfef
parent964bf133bbeb706bd966b85cd55902bcc581d346 (diff)
downloadnsxiv-71a7940d74459c8a575100f93fe43e204413c2db.tar.zst
Better fix for issue #25
-rw-r--r--Makefile2
-rw-r--r--commands.c5
-rw-r--r--main.c7
3 files changed, 7 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 32c644f..16ba138 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = 1.0
+VERSION = git-20111101
CC = gcc
CFLAGS = -ansi -Wall -pedantic -O2
diff --git a/commands.c b/commands.c
index 89dcf8d..a8b9e77 100644
--- a/commands.c
+++ b/commands.c
@@ -69,10 +69,7 @@ bool it_switch_mode(arg_t a) {
img.slideshow = false;
reset_timeout(slideshow);
}
- if (fileidx < tns.cnt)
- tns.sel = fileidx;
- else
- tns.sel = tns.cnt > 0 ? tns.cnt - 1 : 0;
+ tns.sel = fileidx;
tns.dirty = true;
mode = MODE_THUMB;
} else {
diff --git a/main.c b/main.c
index 22729e9..f859090 100644
--- a/main.c
+++ b/main.c
@@ -416,10 +416,13 @@ void run(void) {
{
/* load thumbnails */
set_timeout(redraw, TO_REDRAW_THUMBS, false);
- if (tns_load(&tns, tns.cnt, &files[tns.cnt], false, false))
+ if (tns_load(&tns, tns.cnt, &files[tns.cnt], false, false)) {
tns.cnt++;
- else
+ } else {
remove_file(tns.cnt, false);
+ if (tns.sel >= tns.cnt)
+ tns.sel--;
+ }
if (tns.cnt == filecnt)
redraw();
else