Added new hinting mode to put links into queue.
authorDaniel Carl <danielcarl@gmx.de>
Tue, 30 Jul 2013 20:03:24 +0000 (22:03 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Tue, 30 Jul 2013 20:27:35 +0000 (22:27 +0200)
Also added new default keybinding to open oldest queued item in current window
'ctrl-p'.

doc/vimb.1
src/command.c
src/default.h
src/hints.c
src/hints.h

index 4553632..d2d7572 100644 (file)
@@ -238,6 +238,9 @@ Start hinting to open inputboxes or textareas with external editor.
 .TP
 .BI "hint-save [" QUERY "]"
 Start hinting to download hinted links into configured download directory.
+.TP
+.BI "hint-push [" QUERY "]"
+Start hinting to push hinted URI into the read it later queue.
 
 .SS Yank
 .TP
@@ -489,6 +492,8 @@ Open the last closed page.
 .TP
 .B U
 Open the last closed page into a new window.
+.TP ctrl\-p
+Open the oldest entry from read it later queue in current browser window.
 .TP
 .B ctrl\-q
 Quit the browser.
@@ -577,6 +582,9 @@ Start hinting to open editable form fileds with external editor.
 .B ;\-s
 Start hinting to download the linkes resource.
 .TP
+.B ;\-p
+Start hinting to push hinted URI into queue.
+.TP
 .B y
 Yank the URI or current page into clipboard.
 .TP
index 6f33e19..82921c2 100644 (file)
@@ -94,6 +94,7 @@ static CommandInfo cmd_list[] = {
     {"hint-image-tabopen",        NULL,    command_hints,                {HINTS_TYPE_IMAGE | HINTS_PROCESS_OPEN | HINTS_OPEN_NEW}},
     {"hint-editor",               NULL,    command_hints,                {HINTS_TYPE_EDITABLE}},
     {"hint-save",                 NULL,    command_hints,                {HINTS_TYPE_LINK | HINTS_PROCESS_SAVE}},
+    {"hint-push",                 NULL,    command_hints,                {HINTS_TYPE_LINK | HINTS_PROCESS_PUSH}},
     {"yank-uri",                  "yu",    command_yank,                 {VB_CLIPBOARD_PRIMARY | VB_CLIPBOARD_SECONDARY | COMMAND_YANK_URI}},
     {"yank-selection",            "ys",    command_yank,                 {VB_CLIPBOARD_PRIMARY | VB_CLIPBOARD_SECONDARY | COMMAND_YANK_SELECTION}},
     {"search-forward",            NULL,    command_search,               {VB_SEARCH_FORWARD}},
@@ -486,6 +487,8 @@ gboolean command_hints(const Arg *arg)
                 prefix = ";y";
             } else if (mode & HINTS_PROCESS_SAVE) {
                 prefix = ";s";
+            } else if (mode & HINTS_PROCESS_PUSH) {
+                prefix = ";p";
             }
             break;
 
index a78c71a..18c6065 100644 (file)
@@ -43,6 +43,7 @@ static char *default_config[] = {
     "nmap <ctrl-q>=quit",
     "nmap <ctrl-o>=back",
     "nmap <ctrl-i>=forward",
+    "nmap <ctrl-p>=pop",
     "nmap r=reload",
     "nmap R=reload!",
     "nmap C=stop",
@@ -67,6 +68,7 @@ static char *default_config[] = {
     "nmap ;I=hint-image-tabopen",
     "nmap ;e=hint-editor",
     "nmap ;s=hint-save",
+    "nmap ;p=hint-push",
     "nmap y=yank-uri",
     "nmap Y=yank-selection",
     "nmap p=open-clipboard",
index 2ac4f11..a79ec62 100644 (file)
@@ -169,6 +169,10 @@ static void run_script(char *js)
             a.s = v;
             a.i = COMMAND_SAVE_URI;
             command_save(&a);
+        } else if (mode & HINTS_PROCESS_PUSH) {
+            a.s = v;
+            a.i = COMMAND_QUEUE_PUSH;
+            command_queue(&a);
         } else {
             a.i = VB_CLIPBOARD_PRIMARY | VB_CLIPBOARD_SECONDARY;
             a.s = v;
index aee0db0..6f835b9 100644 (file)
@@ -34,6 +34,7 @@ enum {
     HINTS_PROCESS_SAVE  = (1 << 5),
     /* additional flag for HINTS_PROCESS_OPEN */
     HINTS_OPEN_NEW      = (1 << 6),
+    HINTS_PROCESS_PUSH  = (1 << 7),
 };
 
 void hints_init(WebKitWebFrame *frame);