diff --git a/doc/man/zathurarc.5.rst b/doc/man/zathurarc.5.rst index 94eaaee..405da12 100644 --- a/doc/man/zathurarc.5.rst +++ b/doc/man/zathurarc.5.rst @@ -652,6 +652,14 @@ Defines if the number of pages per row should be honored when advancing a page. * Value type: Boolean * Default value: false +continuous-hist-save +^^^^^^^^^^^^^^^^^^^^ +Tells zathura whether to save document history at each page change or only when +closing a document. + +* Value type: Boolean +* Default value: false + database ^^^^^^^^ Defines the database backend to use for bookmarks and input history. Possible diff --git a/zathura/config.c b/zathura/config.c index 638ad4b..e706dd9 100644 --- a/zathura/config.c +++ b/zathura/config.c @@ -242,6 +242,8 @@ config_load_default(zathura_t* zathura) girara_setting_add(gsession, "synctex-editor-command", string_value, STRING, false, _("Synctex editor command"), NULL, NULL); bool_value = true; girara_setting_add(gsession, "dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service"), NULL, NULL); + bool_value = false; + girara_setting_add(gsession, "continuous-hist-save", &bool_value, BOOLEAN, false, _("Save history at each page change"), NULL, NULL); string_value = "primary"; girara_setting_add(gsession, "selection-clipboard", string_value, STRING, false, _("The clipboard into which mouse-selected data will be written"), NULL, NULL); bool_value = true; diff --git a/zathura/zathura.c b/zathura/zathura.c index c8be589..09fda45 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -1281,6 +1281,12 @@ page_set(zathura_t* zathura, unsigned int page_id) zathura_document_set_current_page_number(zathura->document, page_id); + bool continuous_hist_save = false; + girara_setting_get(zathura->ui.session, "continuous-hist-save", &continuous_hist_save); + if (continuous_hist_save) { + save_fileinfo_to_db(zathura); + } + /* negative position means auto */ return position_set(zathura, -1, -1);