aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
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