MCPcopy Index your code
hub / github.com/VSCodeVim/Vim / runMacro

Method runMacro

src/mode/modeHandler.ts:1206–1238  ·  view source on GitHub ↗
(recordedMacro: RecordedState)

Source from the content-addressed store, hash-verified

1204 }
1205
1206 public async runMacro(recordedMacro: RecordedState): Promise<void> {
1207 let recordedState = new RecordedState();
1208 this.vimState.recordedState = recordedState;
1209
1210 for (const action of recordedMacro.actionsRun) {
1211 const originalLocation = Jump.fromStateNow(this.vimState);
1212
1213 this.vimState.cursorsInitialState = this.vimState.cursors;
1214
1215 recordedState.actionsRun.push(action);
1216
1217 await this.runAction(recordedState, action);
1218
1219 // We just finished a full action; let's clear out our current state.
1220 if (this.vimState.recordedState.actionsRun.length === 0) {
1221 recordedState = new RecordedState();
1222 this.vimState.recordedState = recordedState;
1223 }
1224
1225 if (this.lastMovementFailed) {
1226 break;
1227 }
1228
1229 this.updateView();
1230
1231 if (action.isJump) {
1232 globalState.jumpTracker.recordJump(originalLocation, Jump.fromStateNow(this.vimState));
1233 }
1234 }
1235
1236 this.vimState.dotCommandStatus = DotCommandStatus.Finished;
1237 this.vimState.cursorsInitialState = this.vimState.cursors;
1238 }
1239
1240 private updateSearchHighlights(showHighlights: boolean) {
1241 const cacheKey = this.searchDecorationCacheKey;

Callers

nothing calls this directly

Calls 4

runActionMethod · 0.95
updateViewMethod · 0.95
fromStateNowMethod · 0.80
recordJumpMethod · 0.80

Tested by

no test coverage detected