Start hinting to open images into current or new window. If \fIPREFIX\fP is
given, print this into the inputbox, default ';i' and ';I'.
.TP
+.BI "hint-editor [" PREFIX "]"
+Start hinting to open inputboxes or textareas with external editor. If
+\fIPREFIX\fP is given, print this into the inputbox, default ';e'.
+.TP
.B hint-focus-nex, hint-focus-prevt
Focus next or previous hint.
.SS Yank
.B ;\-I
Start hinting to open images into new window.
.TP
+.B ;\-e
+Start hinting to open editable form fileds with external editor.
+.TP
.B y
Yank the URI or current page into clipboard.
.TP
{"hint-yank", command_hints, {HINTS_TYPE_LINK | HINTS_PROCESS_YANK, ";y"}},
{"hint-image-open", command_hints, {HINTS_TYPE_IMAGE | HINTS_PROCESS_OPEN, ";i"}},
{"hint-image-tabopen", command_hints, {HINTS_TYPE_IMAGE | HINTS_PROCESS_OPEN | HINTS_OPEN_NEW, ";I"}},
+ {"hint-editor", command_hints, {HINTS_TYPE_EDITABLE, ";e"}},
{"hint-focus-next", command_hints_focus, {0}},
{"hint-focus-prev", command_hints_focus, {1}},
{"yank-uri", command_yank, {COMMAND_YANK_PRIMARY | COMMAND_YANK_SECONDARY | COMMAND_YANK_URI}},
"nmap ;y=hint-yank",
"nmap ;i=hint-image-open",
"nmap ;I=hint-image-tabopen",
+ "nmap ;e=hint-editor",
"nmap y=yank-uri",
"nmap Y=yank-selection",
"nmap p=open-clipboard",
char type, usage;
/* convert the mode into the type chare used in the hint script */
- type = mode & HINTS_TYPE_LINK ? 'l' : 'i';
+ if (HINTS_GET_TYPE(mode) == HINTS_TYPE_LINK) {
+ type = 'l';
+ } else if (HINTS_GET_TYPE(mode) == HINTS_TYPE_EDITABLE) {
+ type = 'e';
+ } else {
+ type = 'i';
+ }
if (mode & HINTS_PROCESS_OPEN) {
usage = mode & HINTS_OPEN_NEW ? 'T' : 'O';
vb_set_mode(VB_MODE_NORMAL, true);
} else if (!strncmp(value, "INSERT:", 7)) {
vb_set_mode(VB_MODE_INSERT, false);
+ if (HINTS_GET_TYPE(mode) == HINTS_TYPE_EDITABLE) {
+ command_editor(NULL);
+ }
} else if (!strncmp(value, "DATA:", 5)) {
Arg a = {0};
char *v = (value + 5);
#include "main.h"
-#define HINTS_GET_TYPE(n) ((n) & (HINTS_TYPE_LINK | HINTS_TYPE_IMAGE))
+#define HINTS_GET_TYPE(n) ((n) & (HINTS_TYPE_LINK | HINTS_TYPE_IMAGE | HINTS_TYPE_EDITABLE))
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),
-/* mode: l - links, i - images */
+/* mode: l - links, i - images, e - editables */
/* usage: O - open, T - open in new window, U - use source */
function VimbHints(mode, usage, bg, bgf, fg, style, maxHints)
{
} else {
return "//*[(@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @class='lk' or @role='link' or @href) and contains(., '" + s + "')] | //input[not(@type='hidden') and contains(., '" + s + "')] | //a[@href and contains(., '" + s + "')] | //area[contains(., '" + s + "')] | //textarea[contains(., '" + s + "')] | //button[contains(@value, '" + s + "')] | //select[contains(., '" + s + "')]";
}
+ case "e":
+ if (s === "") {
+ return "//input[@type='text'] | //textarea";
+ } else {
+ return "//input[@type='text' and contains(., '" + s + "')] | //textarea[contains(., '" + s + "')]";
+ }
case "i":
if (s === "") {
return "//img[@src]";