fbpdf: add d command to sleep
authorAli Gholami Rudi <ali@rudi.ir>
Thu, 11 Apr 2013 09:34:57 +0000 (11 14:04 +0430)
committerAli Gholami Rudi <ali@rudi.ir>
Thu, 11 Apr 2013 09:34:57 +0000 (11 14:04 +0430)
I used this command locally almost since I started fbpad; when using
fbpad, fbpdf can draw a pdf page on another fbpad tag.  This makes
it possible to write notes in a multi-window editor, while part of
the pdf page is visible.

README
fbpdf.c

diff --git a/README b/README
index 5050186..1caa9eb 100644 (file)
--- a/README
+++ b/README
@@ -53,4 +53,5 @@ e             reload current file
 f              zoom to fit page height
 w              zoom to fit page width
 W              zoom to fit page contents horizontally
+d              sleep one second before the next command
 ============== ================================================
diff --git a/fbpdf.c b/fbpdf.c
index 8ea7a8e..e8489f0 100644 (file)
--- a/fbpdf.c
+++ b/fbpdf.c
@@ -237,6 +237,9 @@ static void mainloop(void)
                case 'o':
                        numdiff = num - getcount(num);
                        break;
+               case 'd':
+                       sleep(getcount(1));
+                       break;
                default:
                        if (isdigit(c))
                                count = count * 10 + c - '0';