From: Daniel Carl Date: Mon, 5 Aug 2013 17:43:55 +0000 (+0200) Subject: Added new hinting mode to hint element to the beginning of queue. X-Git-Url: https://git.owens.tech/wrapped.html/wrapped.html/git?a=commitdiff_plain;h=515ea87a3c9e4a8dadb8cf4d4f26528ca8b55a55;p=vimb.git Added new hinting mode to hint element to the beginning of queue. --- diff --git a/doc/vimb.1 b/doc/vimb.1 index faf1595..c6b2041 100644 --- a/doc/vimb.1 +++ b/doc/vimb.1 @@ -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 diff --git a/src/command.c b/src/command.c index 7b82409..62b8cb1 100644 --- a/src/command.c +++ b/src/command.c @@ -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}}, diff --git a/src/default.h b/src/default.h index 39b0edf..7dfb4be 100644 --- a/src/default.h +++ b/src/default.h @@ -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 =queue-pop", #endif "nmap y=yank-uri", diff --git a/src/hints.c b/src/hints.c index 007832a..c9d61e2 100644 --- a/src/hints.c +++ b/src/hints.c @@ -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 { diff --git a/src/hints.h b/src/hints.h index a2f5380..ead9d13 100644 --- a/src/hints.h +++ b/src/hints.h @@ -25,17 +25,18 @@ #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 };