Before this patch, if you first moved the cursor to link X with
move-cursor-up and similar actions, and then clicked link Y with the
mouse, ELinks would activate link X, i.e. not the one you clicked.
This happened because the NAVIGATE_CURSOR_ROUTING mode was left
enabled and made ELinks ignore the doc_view->vs->current_link
member that ELinks had updated according to the click.
Make ELinks return the session to NAVIGATE_LINKWISE mode, so that
the update takes effect.

Reported by Paul B. Mahol.
---
"Paul B. Mahol" <one...@gmail.com> writes:

> Using hjkl to move cursor and after that mouse to activate another
> link will cause that it will activate link that is higlighted with
> cursor via hjkl keys(if there is no link highlighted with hjkl keys
> bug doesnt happen) and not one that is pointed with mouse.

Thanks for the report.  I think this patch (for 0.11.5.GIT but
should apply to elinks-0.12 and master too) fixes it.  If you
agree, I'll push this to elinks-0.11 and elinks-0.12.

 NEWS                   |    2 ++
 src/viewer/text/view.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index dc844ab..1abf9e2 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ To be released as 0.11.6.
 * major bug 1004: ignore locales when comparing HTML element names and
   similar strings, so e.g. ``title'' matches ``TITLE'' even in the
   Turkish locale
+* minor: clicking a link with the mouse activates that link, rather
+  than the one selected with move-cursor-* actions
 
 ELinks 0.11.5:
 --------------
diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index ca7c8d5..330cc3d 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -840,6 +840,7 @@ frame_ev_mouse(struct session *ses, struct document_view 
*doc_view, struct term_
                enum frame_event_status status = FRAME_EVENT_REFRESH;
 
                doc_view->vs->current_link = link - doc_view->document->links;
+               ses->navigate_mode = NAVIGATE_LINKWISE;
 
                if (!link_is_textinput(link)) {
 
-- 
1.6.0.5.7.gbebc6
_______________________________________________
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev

Reply via email to