diff --git a/shortcuts.c b/shortcuts.c index 937a8cd..6606d60 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -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)); diff --git a/zathura.c b/zathura.c index d4d638d..70fa5cc 100644 --- a/zathura.c +++ b/zathura.c @@ -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);