nsxiv71a7940
Better fix for issue #25
+7 −7
3 files changed
- M Makefile +1 −1
- M commands.c +1 −4
- M main.c +5 −2
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = 1.0 | |
| 1 | + | VERSION = git-20111101 | |
| 2 | 2 | ||
| 3 | 3 | CC = gcc | |
| 4 | 4 | CFLAGS = -ansi -Wall -pedantic -O2 | |
| @@ -69,10 +69,7 @@ bool it_switch_mode(arg_t a) { | |||
| 69 | 69 | img.slideshow = false; | |
| 70 | 70 | reset_timeout(slideshow); | |
| 71 | 71 | } | |
| 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; | |
| 76 | 73 | tns.dirty = true; | |
| 77 | 74 | mode = MODE_THUMB; | |
| 78 | 75 | } else { | |
| @@ -416,10 +416,13 @@ void run(void) { | |||
| 416 | 416 | { | |
| 417 | 417 | /* load thumbnails */ | |
| 418 | 418 | 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)) { | |
| 420 | 420 | tns.cnt++; | |
| 421 | − | else | |
| 421 | + | } else { | |
| 422 | 422 | remove_file(tns.cnt, false); | |
| 423 | + | if (tns.sel >= tns.cnt) | |
| 424 | + | tns.sel--; | |
| 425 | + | } | |
| 423 | 426 | if (tns.cnt == filecnt) | |
| 424 | 427 | redraw(); | |
| 425 | 428 | else | |