diff --git a/src/vs/editor/common/modes/languageConfigurationRegistry.ts b/src/vs/editor/common/modes/languageConfigurationRegistry.ts index ae25a6533d4d777262794bcd008e873604f2c5ac..1563ebc48de7588b5875e13a99a00e935ed712c3 100644 --- a/src/vs/editor/common/modes/languageConfigurationRegistry.ts +++ b/src/vs/editor/common/modes/languageConfigurationRegistry.ts @@ -288,8 +288,8 @@ export class LanguageConfigurationRegistryImpl { if (range.isEmpty()) { afterEnterText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset); } else { - let endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber); - afterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1); + const endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn); + afterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset); } let lineNumber = range.startLineNumber;