Fix first/last image indexing bug

Fixes #301
This commit is contained in:
Harry Jeffery 2020-12-17 20:18:09 +00:00
parent e3f135a0ad
commit 49ba898e92
3 changed files with 3 additions and 3 deletions

View file

@ -134,7 +134,7 @@ or a modifier is used it must be wrapped in '<' and '>', for example:
'<Ctrl+q>'.
Multiple keys in succession can be specified by listing them in order:
'gg = goto 0' will bind two presses of the 'g' key to jump to the first
'gg = goto 1' will bind two presses of the 'g' key to jump to the first
image, and '<Ctrl+a>p = exec echo hi' will bind the key sequence of 'Ctrl+a'
followed by 'p' to executing the shell command 'echo hi'.

View file

@ -21,7 +21,7 @@ y = exec echo working!
<bracketleft> = prev
<Right> = next
<bracketright> = next
gg = goto 0
gg = goto 1
<Shift+G> = goto -1
# Panning

View file

@ -1641,7 +1641,7 @@ static void command_goto(struct list *args, const char *argstr, void *data)
}
long int index = strtol(args->items[1], NULL, 10);
imv_navigator_select_abs(imv->navigator, index - 1);
imv_navigator_select_abs(imv->navigator, index > 0 ? index - 1 : index);
imv_viewport_reset_transform(imv->view);
imv->slideshow.elapsed = 0;