From c06d353eb77ae1d25baf6b43cec7ea7da90e1a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= Date: Thu, 6 Dec 2012 10:57:04 +0100 Subject: [PATCH] Reverse scroll-wrap's logic When set to true, it used to _not_ wrap around the begining/end. Now it wraps if set to true, and it doesn't if set to false. Signed-off-by: Sebastian Ramacher --- shortcuts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index d13f625..130f18f 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -422,20 +422,20 @@ sc_navigate(girara_session_t* session, girara_argument_t* argument, t = (t == 0) ? (unsigned int) offset : t; if (argument->n == NEXT) { - if (scroll_wrap == true) { + if (scroll_wrap == false) { new_page = new_page + t; } else { new_page = (new_page + t) % number_of_pages; } } else if (argument->n == PREVIOUS) { - if (scroll_wrap == true) { + if (scroll_wrap == false) { new_page = new_page - t; } else { new_page = (new_page + number_of_pages - t) % number_of_pages; } } - if (scroll_wrap == true && (new_page < 0 || new_page >= number_of_pages)) { + if ((new_page < 0 || new_page >= number_of_pages) && !scroll_wrap) { return false; }