From d9f8750c869e707d35ce1a77ff69c68d703fe015 Mon Sep 17 00:00:00 2001 From: Marwan Tanager Date: Fri, 21 Jun 2013 10:02:19 +0200 Subject: [PATCH] Move calls to zathura_jumplist_add surrounding zathura_link_evaluate to zathura_link_evaluate itself This is just in case that zathura_link_evaluate returns without evaluating the link, which would result in a new jump being added for the current position, but without adding a corresponding jump for the target position (actually a second one would be added but the check in zathura_jumplist_add would prevent it from being appended on the linked list since it's position would be the same as the current one, because the link haven't been evaluated). Signed-off-by: Sebastian Ramacher --- callbacks.c | 5 ----- links.c | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/callbacks.c b/callbacks.c index 1212b1d..b9dca4b 100644 --- a/callbacks.c +++ b/callbacks.c @@ -274,10 +274,7 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path, } sc_toggle_index(zathura->ui.session, NULL, NULL, 0); - - /* zathura_jumplist_save is called when entering index mode */ zathura_link_evaluate(zathura, index_element->link); - zathura_jumplist_add(zathura); } g_object_unref(model); @@ -333,9 +330,7 @@ handle_link(GtkEntry* entry, girara_session_t* session, invalid_index = false; switch (action) { case ZATHURA_LINK_ACTION_FOLLOW: - zathura_jumplist_add(zathura); zathura_link_evaluate(zathura, link); - zathura_jumplist_add(zathura); break; case ZATHURA_LINK_ACTION_DISPLAY: zathura_link_display(zathura, link); diff --git a/links.c b/links.c index 968b983..dc5a837 100644 --- a/links.c +++ b/links.c @@ -149,6 +149,8 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link) } } + zathura_jumplist_add(zathura); + /* jump to the page */ page_set(zathura, link->target.page_number); @@ -161,6 +163,8 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link) } else { position_set(zathura, -1, offset.y); } + + zathura_jumplist_add(zathura); } break; case ZATHURA_LINK_GOTO_REMOTE: