Commit f3229a6a authored by Abdó Roig-Maranges's avatar Abdó Roig-Maranges Committed by Sebastian Ramacher

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's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 2b6fa0cf
......@@ -722,7 +722,11 @@ sc_jumplist(girara_session_t* session, girara_argument_t* argument,
zathura_t* zathura = session->global.data;
g_return_val_if_fail(argument != 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* 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);
}
/* 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 */
bool basename_only = false;
girara_setting_get(zathura->ui.session, "statusbar-basename", &basename_only);
......
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