mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 07:23:46 +01:00
Initialize bisect state when opening document
Otherwise, when opening a document at page 1, and no jumps are added, bisect does not understand it has to initialize the bisect range, and does not move from page 1. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
2b6fa0cfe6
commit
f3229a6a5a
@ -722,7 +722,11 @@ sc_jumplist(girara_session_t* session, girara_argument_t* argument,
|
|||||||
zathura_t* zathura = session->global.data;
|
zathura_t* zathura = session->global.data;
|
||||||
g_return_val_if_fail(argument != NULL, false);
|
g_return_val_if_fail(argument != NULL, false);
|
||||||
g_return_val_if_fail(zathura->document != NULL, false);
|
g_return_val_if_fail(zathura->document != NULL, false);
|
||||||
g_return_val_if_fail(zathura->jumplist.size != 0, false);
|
|
||||||
|
/* if no jumps in the jumplist */
|
||||||
|
if (zathura->jumplist.size == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
GtkAdjustment* hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
|
GtkAdjustment* hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
|
||||||
GtkAdjustment* vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
|
GtkAdjustment* vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(session->gtk.view));
|
||||||
|
@ -654,6 +654,11 @@ document_open(zathura_t* zathura, const char* path, const char* password,
|
|||||||
zathura_document_set_adjust_mode(document, ZATHURA_ADJUST_NONE);
|
zathura_document_set_adjust_mode(document, ZATHURA_ADJUST_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* initialize bisect state */
|
||||||
|
zathura->bisect.start = 0;
|
||||||
|
zathura->bisect.last_jump = zathura_document_get_current_page_number(document);
|
||||||
|
zathura->bisect.end = number_of_pages - 1;
|
||||||
|
|
||||||
/* update statusbar */
|
/* update statusbar */
|
||||||
bool basename_only = false;
|
bool basename_only = false;
|
||||||
girara_setting_get(zathura->ui.session, "statusbar-basename", &basename_only);
|
girara_setting_get(zathura->ui.session, "statusbar-basename", &basename_only);
|
||||||
|
Loading…
Reference in New Issue
Block a user