diff options
author | Bert Münnich <ber.t@gmx.com> | 2011-10-31 11:46:56 +0100 |
---|---|---|
committer | Bert Münnich <ber.t@gmx.com> | 2011-10-31 11:46:56 +0100 |
commit | ac1300ae0043ecca645c9af54130a229727860fa (patch) | |
tree | a6e4cef2aee4e3506dbe01a0cdbecdf9c7006ddd /commands.c | |
parent | 1cdbeb972a64e1fb12db5dc05fbaa1428e72bb12 (diff) |
Fixed issue #25: invalid file cnt and sel in thumb mode
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -69,7 +69,10 @@ bool it_switch_mode(arg_t a) { img.slideshow = false; reset_timeout(slideshow); } - tns.sel = fileidx; + if (fileidx < tns.cnt) + tns.sel = fileidx; + else + tns.sel = tns.cnt > 0 ? tns.cnt - 1 : 0; tns.dirty = true; mode = MODE_THUMB; } else { |