From 815f2b5243e2b667b0eae336ac2eff036472f433 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 9 Nov 2010 16:03:53 +0100 Subject: [PATCH] Make 'set scroll_wrap' work as expected. Thank's to wart_. --- config.def.h | 2 +- zathura.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.def.h b/config.def.h index e18e409..ee5e2e9 100644 --- a/config.def.h +++ b/config.def.h @@ -66,7 +66,7 @@ char* uri_command = "firefox %s"; /* uri */ /* additional settings */ gboolean show_scrollbars = FALSE; -gboolean scroll_wrap = FALSE; +gboolean scroll_wrap = TRUE; int adjust_open = ADJUST_BESTFIT; #define SELECTION_STYLE POPPLER_SELECTION_GLYPH #define GOTO_MODE GOTO_LABELS /* GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET */ diff --git a/zathura.c b/zathura.c index 2369a5d..99d4181 100644 --- a/zathura.c +++ b/zathura.c @@ -2092,11 +2092,11 @@ sc_navigate(Argument* argument) int new_page = Zathura.PDF.page_number; if(argument->n == NEXT) - new_page = scroll_wrap ? (new_page + 1) : ((new_page + 1) % number_of_pages); + new_page = scroll_wrap ? ((new_page + 1) % number_of_pages) : (new_page + 1); else if(argument->n == PREVIOUS) - new_page = scroll_wrap ? (new_page - 1) : ((new_page + number_of_pages - 1) % number_of_pages); + new_page = scroll_wrap ? ((new_page + number_of_pages - 1) % number_of_pages) : (new_page - 1); - if (scroll_wrap && (new_page < 0 || new_page >= number_of_pages)) + if (!scroll_wrap && (new_page < 0 || new_page >= number_of_pages)) return; set_page(new_page);