From 49ba898e923b42b2d31fda9a953606a3ac82201c Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 17 Dec 2020 20:18:09 +0000 Subject: Fix first/last image indexing bug Fixes #301 --- doc/imv.5.txt | 2 +- files/imv_config | 2 +- src/imv.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/imv.5.txt b/doc/imv.5.txt index 68d2ec8..9c7eb8f 100644 --- a/doc/imv.5.txt +++ b/doc/imv.5.txt @@ -134,7 +134,7 @@ or a modifier is used it must be wrapped in '<' and '>', for example: ''. 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 'p = exec echo hi' will bind the key sequence of 'Ctrl+a' followed by 'p' to executing the shell command 'echo hi'. diff --git a/files/imv_config b/files/imv_config index 550a4d3..49218c2 100644 --- a/files/imv_config +++ b/files/imv_config @@ -21,7 +21,7 @@ y = exec echo working! = prev = next = next -gg = goto 0 +gg = goto 1 = goto -1 # Panning diff --git a/src/imv.c b/src/imv.c index feed4b8..b83980f 100644 --- a/src/imv.c +++ b/src/imv.c @@ -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; -- cgit v1.2.3