Skip to content

Commit 7fdafca

Browse files
authored
Update HyperSearch.ahk
Update navigation hotkeys Add #v to jump to end of links list Allow for adding links beyond last link index
1 parent 6390433 commit 7fdafca

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

HyperSearch.ahk

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ LocalHotkeysOff()
9797
if (currentControl~="ListBox") {
9898
send "{up}"
9999
} else if (currentControl=="Edit") {
100-
send "{tab}"
100+
send "+{tab}{up}"
101101
} else
102102
send "!a"
103103
}
@@ -458,16 +458,20 @@ InputAlgorithm(*)
458458
} else if(RegExMatch(editBar.value, "^#.+"))
459459
{
460460
try {
461-
try {
462-
usrIndex := Integer(SubStr(editBar.value,2))
463-
if (usrIndex>linkArray.length)
464-
usrIndex:=linkArray.length
465-
linksListbox.choose(usrIndex)
461+
if(RegExMatch(editBar.value, "^#v.*")) {
462+
linksListbox.choose(linkArray.length)
466463
lastLinkIndex:=linksListbox.value
467-
} catch {
468-
linksListbox.choose(SubStr(editBar.value,2))
464+
} else {
465+
try {
466+
usrIndex := Integer(SubStr(editBar.value,2))
467+
if (usrIndex>linkArray.length)
468+
usrIndex:=linkArray.length
469+
linksListbox.choose(usrIndex)
470+
lastLinkIndex:=linksListbox.value
471+
} catch {
472+
linksListbox.choose(SubStr(editBar.value,2))
473+
}
469474
}
470-
471475
SetLinkHighlight()
472476
} catch {
473477
sleep 50
@@ -629,6 +633,14 @@ AppendLinks(*)
629633
}
630634
}
631635
lastLinkIndex := linkIndex
636+
if (linkIndex>linkArray.length) {
637+
diff := linkIndex - linkArray.length
638+
i:=1
639+
while i<= diff {
640+
linkArray.InsertAt(0,["",""])
641+
i++
642+
}
643+
}
632644
if (linkTxt[3] != "" && linkTxt.Has(4)) {
633645
cleanLabel := CleanLabels(linkTxt[3])
634646
linkArray.InsertAt(linkIndex,[cleanLabel,linkTxt[4]]) ; Insert at specified position

0 commit comments

Comments
 (0)