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

Method init

content_scripts/mode_visual.js:552–577  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

550
551class CaretMode extends VisualMode {
552 init(options) {
553 if (options == null) {
554 options = {};
555 }
556 super.init(
557 Object.assign(options, { name: "caret", indicator: "Caret mode", alterMethod: "move" }),
558 );
559
560 // Establish the initial caret.
561 switch (this.selection.type) {
562 case "None":
563 this.establishInitialSelectionAnchor();
564 if (this.selection.type === "None") {
565 this.exit();
566 HUD.show("Create a selection before entering visual mode.", 2500);
567 return;
568 }
569 break;
570 case "Range":
571 this.movement.collapseSelectionToAnchor();
572 break;
573 }
574
575 this.movement.extendByOneCharacter(forward);
576 return this.movement.scrollIntoView();
577 }
578
579 commandHandler(...args) {
580 this.movement.collapseSelectionToAnchor();

Callers 6

initMethod · 0.45
"/"Function · 0.45
"v"Function · 0.45
"V"Function · 0.45
"c"Function · 0.45
initMethod · 0.45

Calls 6

extendByOneCharacterMethod · 0.80
scrollIntoViewMethod · 0.80
exitMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected