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 <sebastian+dev@ramacher.at>
This commit is contained in:
Marwan Tanager 2013-06-21 10:02:19 +02:00 committed by Sebastian Ramacher
parent 3e5bfe3d59
commit d9f8750c86
2 changed files with 4 additions and 5 deletions

View file

@ -274,10 +274,7 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
} }
sc_toggle_index(zathura->ui.session, NULL, NULL, 0); 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_link_evaluate(zathura, index_element->link);
zathura_jumplist_add(zathura);
} }
g_object_unref(model); g_object_unref(model);
@ -333,9 +330,7 @@ handle_link(GtkEntry* entry, girara_session_t* session,
invalid_index = false; invalid_index = false;
switch (action) { switch (action) {
case ZATHURA_LINK_ACTION_FOLLOW: case ZATHURA_LINK_ACTION_FOLLOW:
zathura_jumplist_add(zathura);
zathura_link_evaluate(zathura, link); zathura_link_evaluate(zathura, link);
zathura_jumplist_add(zathura);
break; break;
case ZATHURA_LINK_ACTION_DISPLAY: case ZATHURA_LINK_ACTION_DISPLAY:
zathura_link_display(zathura, link); zathura_link_display(zathura, link);

View file

@ -149,6 +149,8 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
} }
} }
zathura_jumplist_add(zathura);
/* jump to the page */ /* jump to the page */
page_set(zathura, link->target.page_number); page_set(zathura, link->target.page_number);
@ -161,6 +163,8 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
} else { } else {
position_set(zathura, -1, offset.y); position_set(zathura, -1, offset.y);
} }
zathura_jumplist_add(zathura);
} }
break; break;
case ZATHURA_LINK_GOTO_REMOTE: case ZATHURA_LINK_GOTO_REMOTE: