moved Vimperator hint char generation out of loop

This commit is contained in:
Chic-Tweetz 2025-01-27 17:16:25 +00:00 committed by Oliver Blanthorn
parent 83d11d4846
commit 2820c94a50
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -893,10 +893,12 @@ function buildHintsVimperator(
) {
const hintablesfiltered = hintablesArray.map(h => ({ elements: h.elements.filter(el => Hint.isHintable(el)), hintclasses: h.hintclasses }))
const totalhints = hintablesfiltered.reduce((n, h) => n + h.elements.length, 0)
const allnames = Array.from(
hintnames(totalhints + modeState.hints.length),
).slice(modeState.hints.length)
for (const hintables of hintablesfiltered) {
const names = Array.from(
hintnames(totalhints + modeState.hints.length),
).slice(modeState.hints.length)
const names = allnames.slice(modeState.hints.length)
for (const [el, name] of izip(hintables.elements, names)) {
let ft = elementFilterableText(el)
ft = vimpHelper.sanitiseHintText(ft)