diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 434a3981461..04fc21e60e0 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1797,6 +1797,10 @@ namespace FourSlash { // this.languageService.getScriptLexicalStructure(fileName); } + if (this.currentCaretPosition < 0) { + this.currentCaretPosition = 0; + } + if (isFormattingEdit) { const newContent = this.getFileContent(fileName);