Hey Hannes,
Here's a v2 of the patch that I actually prefer. This one achieves the
same thing, but filters out in javascript those elements that are not
valid for yank or show. This helps reduce the screen clutter so that
it looks the same as it did originally while still keeping the hint
numbers consistent. It also gets rid of the ugly "undefined" checks in
the C code.
I tried to recreate the same checks as the original xpath, but as per
my usual disclaimer, I'm not an xpath expert so please take a look. :)
Regards,
Morgan
PS. I have 3 small patches sent to the list while you were away, but
sourceforge was acting up and there haven't been any comments on them.
Let me know if they're in your queue or rejected, or if I should
resend.
On Fri, Jan 23, 2015 at 1:38 AM, Hannes Schüller <[email protected]> wrote:
> Hi!
>
> Morgan Howe <[email protected]> wrote:
>> I found it a bit irritating that hints are numbered differently in
>> open mode as compared with yank or show modes, so this patch fixes
>> that issue.
>
> I don't find this particularly controversial. It makes sense to me and
> to be honest, I'm actually surprised that this isn't already the case.
>
> Any other adversial comments?
>
> Hannes
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> Vimprobable-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/vimprobable-users
From b55e359e12cddd5821ef38cc131a0d853081be48 Mon Sep 17 00:00:00 2001
From: Morgan Howe <[email protected]>
Date: Thu, 22 Jan 2015 16:35:28 +0800
Subject: [PATCH] Preserve hint numbering across f, l, and y hint modes.
This patch will make sure that hints are numbered the same in show_link
and yank as they are in open mode.
---
hinting.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hinting.js b/hinting.js
index 7814a1f..fd209a6 100644
--- a/hinting.js
+++ b/hinting.js
@@ -86,6 +86,13 @@ function Hints() {
if (style.display == "none" || style.visibility != "visible") {
continue;
}
+ if (mode == "y" || mode == "l") {
+ if (elem.getAttribute("href") == undefined && elem.getAttribute("role") != "link"
+ && elem.tagName.toLowerCase() != "img") {
+ hintCount++;
+ continue;
+ }
+ }
var leftpos = Math.max((rect.left + scrollX), scrollX);
var toppos = Math.max((rect.top + scrollY), scrollY);
@@ -442,6 +449,8 @@ function Hints() {
switch (mode) {
case "f":
case "F":
+ case "y":
+ case "l":
if (text === "") {
expr = "//*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @class='lk' or @role='link' or @href] | //input[not(@type='hidden')] | //a[href] | //area | //textarea | //button | //select";
} else {
--
2.2.1
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Vimprobable-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vimprobable-users