MCPcopy
hub / github.com/VSCodeVim/Vim / exec

Method exec

src/actions/commands/actions.ts:610–632  ·  view source on GitHub ↗
(position: Position, vimState: VimState)

Source from the content-addressed store, hash-verified

608 override createsUndoPoint = true;
609
610 public override async exec(position: Position, vimState: VimState): Promise<void> {
611 const lines: string[] = [];
612
613 for (const { line, start, end } of TextEditor.iterateLinesInBlock(vimState)) {
614 lines.push(line);
615 vimState.recordedState.transformer.addTransformation({
616 type: 'deleteRange',
617 range: new vscode.Range(start, end),
618 manuallySetCursorPositions: true,
619 });
620 }
621
622 const text = lines.length === 1 ? lines[0] : lines.join('\n');
623 vimState.currentRegisterMode = RegisterMode.BlockWise;
624 Register.put(vimState, text, this.multicursorIndex, true);
625
626 vimState.cursors = [
627 Cursor.atPosition(
628 visualBlockGetTopLeftPosition(vimState.cursorStopPosition, vimState.cursorStartPosition),
629 ),
630 ];
631 await vimState.setCurrentMode(Mode.Normal);
632 }
633}
634
635@RegisterAction

Callers

nothing calls this directly

Calls 7

iterateLinesInBlockMethod · 0.80
addTransformationMethod · 0.80
joinMethod · 0.80
putMethod · 0.80
atPositionMethod · 0.80
setCurrentModeMethod · 0.45

Tested by

no test coverage detected