MCPcopy
hub / github.com/philc/vimium / updateKeyState

Method updateKeyState

content_scripts/link_hints.js:592–613  ·  view source on GitHub ↗
({ hintKeystrokeQueue, linkTextKeystrokeQueue, tabCount })

Source from the content-addressed store, hash-verified

590 }
591
592 updateKeyState({ hintKeystrokeQueue, linkTextKeystrokeQueue, tabCount }) {
593 Object.assign(this.markerMatcher, { hintKeystrokeQueue, linkTextKeystrokeQueue });
594
595 const { linksMatched, userMightOverType } = this.markerMatcher.getMatchingHints(
596 this.hintMarkers,
597 tabCount,
598 );
599 if (linksMatched.length === 0) {
600 this.deactivateMode();
601 } else if (linksMatched.length === 1) {
602 this.activateLink(linksMatched[0], userMightOverType);
603 } else {
604 for (const marker of this.hintMarkers) {
605 this.hideMarker(marker);
606 }
607 for (const matched of linksMatched) {
608 this.showMarker(matched, this.markerMatcher.hintKeystrokeQueue.length);
609 }
610 }
611
612 return this.setIndicator();
613 }
614
615 markerOverlapsStack(marker, stack) {
616 for (const otherMarker of stack) {

Callers 1

updateKeyStateFunction · 0.80

Calls 6

deactivateModeMethod · 0.95
activateLinkMethod · 0.95
hideMarkerMethod · 0.95
showMarkerMethod · 0.95
setIndicatorMethod · 0.95
getMatchingHintsMethod · 0.45

Tested by

no test coverage detected