mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 22:13:48 +01:00
Evaluate number of calls in sc_navigate
This commit is contained in:
parent
b133a75717
commit
6d1240d796
@ -132,7 +132,7 @@ sc_goto(girara_session_t* session, girara_argument_t* argument, unsigned int t)
|
||||
|
||||
bool
|
||||
sc_navigate(girara_session_t* session, girara_argument_t* argument, unsigned int
|
||||
UNUSED(t))
|
||||
t)
|
||||
{
|
||||
g_return_val_if_fail(session != NULL, false);
|
||||
g_return_val_if_fail(session->global.data != NULL, false);
|
||||
@ -143,10 +143,11 @@ sc_navigate(girara_session_t* session, girara_argument_t* argument, unsigned int
|
||||
unsigned int number_of_pages = zathura->document->number_of_pages;
|
||||
unsigned int new_page = zathura->document->current_page_number;
|
||||
|
||||
t = (t == 0) ? 1 : t;
|
||||
if (argument->n == NEXT) {
|
||||
new_page = (new_page + 1) % number_of_pages;
|
||||
new_page = (new_page + t) % number_of_pages;
|
||||
} else if (argument->n == PREVIOUS) {
|
||||
new_page = (new_page + number_of_pages - 1) % number_of_pages;
|
||||
new_page = (new_page + number_of_pages - t) % number_of_pages;
|
||||
}
|
||||
|
||||
page_set(zathura, new_page);
|
||||
|
Loading…
Reference in New Issue
Block a user