Commit c06d353e authored by Benoît Knecht's avatar Benoît Knecht Committed by Sebastian Ramacher

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's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 824843a9
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment