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

Function initializeModeState

tests/dom_tests/dom_tests.js:7–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5// setup. Also, some tests affect the focus (e.g. Vomnibar tests), so we make sure the window has
6// the focus.
7const initializeModeState = () => {
8 globalThis.focus();
9 Mode.reset();
10 handlerStack.reset();
11 const normalMode = installModes();
12 normalMode.setPassKeys("p");
13 normalMode.setKeyMapping({
14 m: { options: {}, command: "m" }, // A mapped key.
15 p: { options: {}, command: "p" }, // A pass key.
16 z: { p: { options: {}, command: "zp" } }, // Not a pass key.
17 });
18 normalMode.setCommandHandler(({ command, count }) => {
19 [commandName, commandCount] = [command.command, count];
20 });
21 commandName = null;
22 commandCount = null;
23 return normalMode;
24};
25
26//
27// Retrieve the hint markers as an array object.

Callers 2

createGeneralHintTestsFunction · 0.85
dom_tests.jsFile · 0.85

Calls 5

installModesFunction · 0.85
setPassKeysMethod · 0.80
setKeyMappingMethod · 0.80
setCommandHandlerMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected