From 2371550807bdb972988cce6c3a77d08f663318d4 Mon Sep 17 00:00:00 2001 From: Felix Kaiser Date: Sat, 15 Oct 2016 00:49:21 +0200 Subject: [PATCH] Make page mode toggling predictable Previously, toggling page mode would jump to near page, but usually not the one your were looking at before. --- zathura/shortcuts.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zathura/shortcuts.c b/zathura/shortcuts.c index 7020586..26da4fb 100644 --- a/zathura/shortcuts.c +++ b/zathura/shortcuts.c @@ -1224,6 +1224,8 @@ sc_toggle_page_mode(girara_session_t* session, girara_argument_t* return false; } + unsigned int page_id = zathura_document_get_current_page_number(zathura->document); + int pages_per_row = 1; girara_setting_get(zathura->ui.session, "pages-per-row", &pages_per_row); @@ -1237,6 +1239,10 @@ sc_toggle_page_mode(girara_session_t* session, girara_argument_t* girara_setting_set(zathura->ui.session, "pages-per-row", &value); adjust_view(zathura); + page_set(zathura, page_id); + render_all(zathura); + refresh_view(zathura); + return true; }