This commit is contained in:
Johannes Rieken
2018-07-26 19:10:58 +02:00
parent 4c5c94185f
commit 9cc1fc914d
2 changed files with 29 additions and 4 deletions

View File

@@ -497,6 +497,11 @@ export class ExtHostTextEditor implements vscode.TextEditor {
private _applyEdit(editBuilder: TextEditorEdit): TPromise<boolean> {
let editData = editBuilder.finalize();
// return when there is nothing to do
if (editData.edits.length === 0 && !editData.setEndOfLine) {
return TPromise.wrap(true);
}
// check that the edits are not overlapping (i.e. illegal)
let editRanges = editData.edits.map(edit => edit.range);