Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2 (#8911)

* Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2

* update distro

* fix layering

* update distro

* fix tests
This commit is contained in:
Anthony Dresser
2020-01-22 13:42:37 -08:00
committed by GitHub
parent 977111eb21
commit bd7aac8ee0
895 changed files with 24651 additions and 14520 deletions

View File

@@ -727,7 +727,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
case H.Paste:
cursorChangeReason = CursorChangeReason.Paste;
this._paste(<string>payload.text, <boolean>payload.pasteOnNewLine, <string[]>payload.multicursorText);
this._paste(<string>payload.text, <boolean>payload.pasteOnNewLine, <string[]>payload.multicursorText || []);
break;
case H.Cut:
@@ -1000,7 +1000,7 @@ class CommandExecutor {
let operations: IIdentifiedSingleEditOperation[] = [];
let operationMinor = 0;
const addEditOperation = (selection: Range, text: string | null) => {
const addEditOperation = (selection: Range, text: string | null, forceMoveMarkers: boolean = false) => {
if (selection.isEmpty() && text === '') {
// This command wants to add a no-op => no thank you
return;
@@ -1012,15 +1012,15 @@ class CommandExecutor {
},
range: selection,
text: text,
forceMoveMarkers: false,
forceMoveMarkers: forceMoveMarkers,
isAutoWhitespaceEdit: command.insertsAutoWhitespace
});
};
let hadTrackedEditOperation = false;
const addTrackedEditOperation = (selection: Range, text: string | null) => {
const addTrackedEditOperation = (selection: Range, text: string | null, forceMoveMarkers?: boolean) => {
hadTrackedEditOperation = true;
addEditOperation(selection, text);
addEditOperation(selection, text, forceMoveMarkers);
};
const trackSelection = (selection: Selection, trackPreviousOnEmpty?: boolean) => {