From da3c6d21efed61ce8a648b6fe14e4563e937c24b Mon Sep 17 00:00:00 2001 From: Andreas Hellquist Date: Tue, 9 Feb 2021 20:35:15 +0000 Subject: [PATCH] Fixed zathura going to first page when toggling index mode after using the inputbar --- zathura/shortcuts.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zathura/shortcuts.c b/zathura/shortcuts.c index d53dacd..863536a 100644 --- a/zathura/shortcuts.c +++ b/zathura/shortcuts.c @@ -1187,6 +1187,14 @@ sc_toggle_index(girara_session_t* session, girara_argument_t* UNUSED(argument), /* save current position to the jumplist */ zathura_jumplist_add(zathura); + const zathura_adjust_mode_t adjust_mode = + zathura_document_get_adjust_mode(zathura->document); + + /* zathura goes to the first page when toggling index mode if this isn't done */ + if (adjust_mode == ZATHURA_ADJUST_INPUTBAR) { + zathura_document_set_adjust_mode(zathura->document, ZATHURA_ADJUST_NONE); + } + girara_set_view(session, zathura->ui.index); gtk_widget_show(GTK_WIDGET(zathura->ui.index)); girara_mode_set(zathura->ui.session, zathura->modes.index);