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

Method init

content_scripts/mode_normal.js:2–25  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

1class NormalMode extends KeyHandlerMode {
2 init(options) {
3 if (options == null) {
4 options = {};
5 }
6
7 const defaults = {
8 name: "normal",
9 indicator: false, // There is normally no mode indicator in normal mode.
10 commandHandler: this.commandHandler.bind(this),
11 };
12
13 super.init(Object.assign(defaults, options));
14
15 chrome.storage.session.get(
16 "normalModeKeyStateMapping",
17 (items) => this.setKeyMapping(items.normalModeKeyStateMapping),
18 );
19
20 chrome.storage.onChanged.addListener((changes, area) => {
21 if (area === "session" && changes.normalModeKeyStateMapping?.newValue) {
22 this.setKeyMapping(changes.normalModeKeyStateMapping.newValue);
23 }
24 });
25 }
26
27 commandHandler({ command: registryEntry, count }) {
28 if (registryEntry.options.count) {

Callers 2

enterNormalModeFunction · 0.95
constructorMethod · 0.45

Calls 2

getMethod · 0.80
setKeyMappingMethod · 0.80

Tested by

no test coverage detected