diff options
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 { |