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

Method escape

src/cmd_line/commandLine.ts:504–520  ·  view source on GitHub ↗
(vimState: VimState)

Source from the content-addressed store, hash-verified

502 }
503
504 public async escape(vimState: VimState): Promise<void> {
505 vimState.cursorStopPosition = this.searchState.cursorStartPosition;
506
507 globalState.searchState = SearchCommandLine.previousSearchStates.at(-1);
508
509 if (vimState.modeData.mode === Mode.SearchInProgressMode) {
510 const offset =
511 vimState.editor.visibleRanges[0].start.line -
512 vimState.modeData.firstVisibleLineBeforeSearch;
513 scrollView(vimState, offset);
514 }
515
516 await vimState.setCurrentMode(this.previousMode);
517 if (this.text.length > 0) {
518 void SearchCommandLine.addSearchStateToHistory(this.searchState);
519 }
520 }
521
522 public async ctrlF(vimState: VimState): Promise<void> {
523 await SearchCommandLine.onSearch(vimState, this.searchState.direction);

Callers

nothing calls this directly

Calls 3

scrollViewFunction · 0.90
setCurrentModeMethod · 0.45

Tested by

no test coverage detected