diff options
author | Alexandru Dima <alexdima@microsoft.com> | 2022-07-20 12:36:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-20 12:36:33 +0300 |
commit | 2936058b31acc795e5e4bae0040be40134d771d9 (patch) | |
tree | 4228626c403807735d0e9a1e6c4c79b497d09c83 /src | |
parent | a237707f58cdae6f7bd243149465a3d9f4373b88 (diff) |
Fixes #154755 (#155706)
Diffstat (limited to 'src')
-rw-r--r-- | src/vs/editor/browser/widget/codeEditorWidget.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index f4e8c0d10db..0cc2cfa02af 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -1177,9 +1177,10 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE if (!this._modelData || text.length === 0) { return; } - const startPosition = this._modelData.viewModel.getSelection().getStartPosition(); - this._modelData.viewModel.paste(text, pasteOnNewLine, multicursorText, source); - const endPosition = this._modelData.viewModel.getSelection().getStartPosition(); + const viewModel = this._modelData.viewModel; + const startPosition = viewModel.getSelection().getStartPosition(); + viewModel.paste(text, pasteOnNewLine, multicursorText, source); + const endPosition = viewModel.getSelection().getStartPosition(); if (source === 'keyboard') { this._onDidPaste.fire({ range: new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column), |