From 866b8c5e1d8a40a4b54d0afa6c2429dcf1636bfc Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Mon, 5 May 2014 18:30:01 +0430 Subject: [PATCH] fbpdf: O command sets page number and shows current page For instance, the command '3O' in page 5 of a file: 1. Updates current page number so that the command 'nG' shows page n + 2, where n is the prefix (just like the command '3o'). 2. Invokes command G with current page as its prefix, i.e., '5G', which shows page 7. --- README | 3 ++- fbpdf.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README b/README index 547d5c7..a91c2fe 100644 --- a/README +++ b/README @@ -26,7 +26,8 @@ KEY ACTION ^F/J next page ^B/K previous page G go to page (the last page if no prefix) -o set current page number (for 'G' command only) +o set page number (for 'G' command only) +O set page number and go to current page z zoom; prefix multiplied by 10 (i.e. '15z' = 150%) r set rotation in degrees i print info diff --git a/fbpdf.c b/fbpdf.c index ca52a01..b5edb4a 100644 --- a/fbpdf.c +++ b/fbpdf.c @@ -198,6 +198,14 @@ static void mainloop(void) setmark('\''); showpage(getcount(doc_pages(doc) - numdiff) + numdiff, 0); break; + case 'O': + numdiff = num - getcount(num); + setmark('\''); + showpage(num + numdiff, 0); + break; + case 'o': + numdiff = num - getcount(num); + break; case 'z': zoom_page(getcount(zoom_def)); break; @@ -238,9 +246,6 @@ static void mainloop(void) case '\'': jmpmark(readkey(), c == '`'); break; - case 'o': - numdiff = num - getcount(num); - break; case 'd': sleep(getcount(1)); break; -- 2.11.4.GIT