mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-01 03:36:26 -04:00
Accesskey didn't work as it should.
[ Backported from commit 682ad62a97
in ELinks 0.12.GIT. --KON ]
This commit is contained in:
parent
518cf082db
commit
94ff057a6c
@ -1093,7 +1093,6 @@ try_document_key(struct session *ses, struct document_view *doc_view,
|
|||||||
struct term_event *ev)
|
struct term_event *ev)
|
||||||
{
|
{
|
||||||
long key;
|
long key;
|
||||||
int passed = -1;
|
|
||||||
int i; /* GOD I HATE C! --FF */ /* YEAH, BRAINFUCK RULEZ! --pasky */
|
int i; /* GOD I HATE C! --FF */ /* YEAH, BRAINFUCK RULEZ! --pasky */
|
||||||
|
|
||||||
assert(ses && doc_view && doc_view->document && doc_view->vs && ev);
|
assert(ses && doc_view && doc_view->document && doc_view->vs && ev);
|
||||||
@ -1108,24 +1107,23 @@ try_document_key(struct session *ses, struct document_view *doc_view,
|
|||||||
* key we test.. */
|
* key we test.. */
|
||||||
key = get_kbd_key(ev);
|
key = get_kbd_key(ev);
|
||||||
|
|
||||||
for (i = 0; i < doc_view->document->nlinks; i++) {
|
i = doc_view->vs->current_link >= 0 ? doc_view->vs->current_link : 0;
|
||||||
|
for (; i < doc_view->document->nlinks; i++) {
|
||||||
struct link *link = &doc_view->document->links[i];
|
struct link *link = &doc_view->document->links[i];
|
||||||
|
|
||||||
if (key == link->accesskey) { /* FIXME: key vs unicode ... */
|
if (key == link->accesskey) { /* FIXME: key vs unicode ... */
|
||||||
if (passed != i && i <= doc_view->vs->current_link) {
|
|
||||||
/* This is here in order to rotate between
|
|
||||||
* links with same accesskey. */
|
|
||||||
if (passed < 0) passed = i;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
ses->kbdprefix.repeat_count = 0;
|
ses->kbdprefix.repeat_count = 0;
|
||||||
goto_link_number_do(ses, doc_view, i);
|
goto_link_number_do(ses, doc_view, i);
|
||||||
return FRAME_EVENT_REFRESH;
|
return FRAME_EVENT_REFRESH;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
for (i = 0; i < doc_view->vs->current_link; i++) {
|
||||||
|
struct link *link = &doc_view->document->links[i];
|
||||||
|
|
||||||
if (i == doc_view->document->nlinks - 1 && passed >= 0) {
|
if (key == link->accesskey) { /* FIXME: key vs unicode ... */
|
||||||
/* Return to the start. */
|
ses->kbdprefix.repeat_count = 0;
|
||||||
i = passed - 1;
|
goto_link_number_do(ses, doc_view, i);
|
||||||
|
return FRAME_EVENT_REFRESH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user