mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-02-27 14:04:57 +01:00
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:
parent
3e5bfe3d59
commit
d9f8750c86
2 changed files with 4 additions and 5 deletions
|
@ -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);
|
||||
|
|
4
links.c
4
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:
|
||||
|
|
Loading…
Add table
Reference in a new issue