From cb7e3d346d880ce50209779ccaceec78321e29bc Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Sun, 23 Jun 2013 23:03:34 +0200
Subject: [PATCH] Added @placeholder matching for hinting.

This allows to hint input elements with html5 placeholder attributes that
holds a dummy content for the input field.
---
 src/hints.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/hints.js b/src/hints.js
index b8d2df5..3a6474d 100644
--- a/src/hints.js
+++ b/src/hints.js
@@ -348,8 +348,8 @@ function VimbHints(mode, usage, bg, bgf, fg, style, maxHints)
                     return "//a[@href] | //*[@onclick or @tabindex or @class='lk' or @role='link' or @role='button'] | //input[not(@type='hidden' or @disabled or @readonly)] | //area[@href] | //textarea[not(@disabled or @readonly)] | //button | //select";
                 }
                 return _buildQuery(
-                    ["@value", "."],
-                    "//a[@href and $.] | //*[(@onclick or @class='lk' or @role='link' or role='button') and $.] | //input[not(@type='hidden' or @disabled or @readonly) and $@value] | //area[$.] | //textarea[not(@disabled or @readonly) and $.] | //button[$.] | //select[$.]",
+                    ["@value", ".", "@placeholder"],
+                    "//a[@href and $.] | //*[(@onclick or @class='lk' or @role='link' or role='button') and $.] | //input[not(@type='hidden' or @disabled or @readonly) and ($@value or $@placeholder)] | //area[$.] | //textarea[not(@disabled or @readonly) and $.] | //button[$.] | //select[$.]",
                     s
                 );
             case "e":
@@ -357,8 +357,8 @@ function VimbHints(mode, usage, bg, bgf, fg, style, maxHints)
                     return "//input[@type='text'] | //textarea";
                 }
                 return _buildQuery(
-                    ["@value", "."],
-                    "//input[@type='text' and $@value] | //textarea[$.]",
+                    ["@value", ".", "@placeholder"],
+                    "//input[@type='text' and ($@value or $@placeholder)] | //textarea[$.]",
                     s
                 );
             case "i":
-- 
2.20.1