Added new hinting mode to hint element to the beginning of queue.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 5 Aug 2013 17:43:55 +0000 (19:43 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 5 Aug 2013 17:59:53 +0000 (19:59 +0200)
doc/vimb.1
src/command.c
src/default.h
src/hints.c
src/hints.h

index faf1595..c6b2041 100644 (file)
@@ -240,8 +240,12 @@ Start hinting to open inputboxes or textareas with external editor.
 Start hinting to download hinted links into configured download directory.
 .TP
 .BI "hint-queue-push [" QUERY "]"
-Start hinting to push hinted URI into the read it later queue. If PROJECT hab
+Start hinting to push hinted URI into the read it later queue. If PROJECT has
 been compiled with QUEUE feature.
+.TP
+.BI "hint-queue-unshift [" QUERY "]"
+Start hinting to push hinted URI to begin of read it later queue. If PROJECT
+has been compiled with QUEUE feature.
 
 .SS Yank
 .TP
@@ -596,6 +600,10 @@ Start hinting to download the linkes resource.
 If PROJECT has been compiled with QUEUE feature. Start hinting to push hinted
 URI into queue.
 .TP
+.B ;\-P
+If PROJECT has been compiled with QUEUE feature. Start hinting to push hinted
+URI to the beginning of the queu.
+.TP
 .B y
 Yank the URI or current page into clipboard.
 .TP
index 7b82409..62b8cb1 100644 (file)
@@ -96,6 +96,7 @@ static CommandInfo cmd_list[] = {
     {"hint-save",                 NULL,    command_hints,                {HINTS_TYPE_LINK | HINTS_PROCESS_SAVE}},
 #ifdef FEATURE_QUEUE
     {"hint-queue-push",           NULL,    command_hints,                {HINTS_TYPE_LINK | HINTS_PROCESS_PUSH}},
+    {"hint-queue-unshift",        NULL,    command_hints,                {HINTS_TYPE_LINK | HINTS_PROCESS_UNSHIFT}},
 #endif
     {"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}},
index 39b0edf..7dfb4be 100644 (file)
@@ -69,6 +69,7 @@ static char *default_config[] = {
     "nmap ;s=hint-save",
 #ifdef FEATURE_QUEUE
     "nmap ;p=hint-queue-push",
+    "nmap ;P=hint-queue-unshift",
     "nmap <ctrl-p>=queue-pop",
 #endif
     "nmap y=yank-uri",
index 007832a..c9d61e2 100644 (file)
@@ -175,6 +175,10 @@ static void run_script(char *js)
             a.s = v;
             a.i = COMMAND_QUEUE_PUSH;
             command_queue(&a);
+        } else if (mode & HINTS_PROCESS_UNSHIFT) {
+            a.s = v;
+            a.i = COMMAND_QUEUE_UNSHIFT;
+            command_queue(&a);
         }
 #endif
         else {
index a2f5380..ead9d13 100644 (file)
 #define HINTS_GET_TYPE(n) ((n) & (HINTS_TYPE_LINK | HINTS_TYPE_IMAGE))
 
 enum {
-    HINTS_TYPE_LINK     = 1,
-    HINTS_TYPE_IMAGE    = 2,
-    HINTS_TYPE_EDITABLE = 3,
-    HINTS_PROCESS_INPUT = (1 << 2),
-    HINTS_PROCESS_YANK  = (1 << 3),
-    HINTS_PROCESS_OPEN  = (1 << 4),
-    HINTS_PROCESS_SAVE  = (1 << 5),
+    HINTS_TYPE_LINK       = 1,
+    HINTS_TYPE_IMAGE      = 2,
+    HINTS_TYPE_EDITABLE   = 3,
+    HINTS_PROCESS_INPUT   = (1 << 2),
+    HINTS_PROCESS_YANK    = (1 << 3),
+    HINTS_PROCESS_OPEN    = (1 << 4),
+    HINTS_PROCESS_SAVE    = (1 << 5),
     /* additional flag for HINTS_PROCESS_OPEN */
-    HINTS_OPEN_NEW      = (1 << 6),
+    HINTS_OPEN_NEW        = (1 << 6),
 #ifdef FEATURE_QUEUE
-    HINTS_PROCESS_PUSH  = (1 << 7),
+    HINTS_PROCESS_PUSH    = (1 << 7),
+    HINTS_PROCESS_UNSHIFT = (1 << 8),
 #endif
 };