Commit d9f8750c authored by Marwan Tanager's avatar Marwan Tanager Committed by Sebastian Ramacher

Move calls to zathura_jumplist_add surrounding zathura_link_evaluate to...

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's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 3e5bfe3d
......@@ -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);
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment