Merge from vscode 52dcb723a39ae75bee1bd56b3312d7fcdc87aeed (#6719)

This commit is contained in:
Anthony Dresser
2019-08-12 21:31:51 -07:00
committed by GitHub
parent 00250839fc
commit 7eba8c4c03
616 changed files with 9472 additions and 7087 deletions

View File

@@ -20,7 +20,7 @@ export class MoveLinesCommand implements ICommand {
private readonly _isMovingDown: boolean;
private readonly _autoIndent: boolean;
private _selectionId: string;
private _selectionId: string | null;
private _moveEndPositionDown?: boolean;
private _moveEndLineSelectionShrink: boolean;
@@ -28,6 +28,7 @@ export class MoveLinesCommand implements ICommand {
this._selection = selection;
this._isMovingDown = isMovingDown;
this._autoIndent = autoIndent;
this._selectionId = null;
this._moveEndLineSelectionShrink = false;
}
@@ -36,9 +37,11 @@ export class MoveLinesCommand implements ICommand {
let modelLineCount = model.getLineCount();
if (this._isMovingDown && this._selection.endLineNumber === modelLineCount) {
this._selectionId = builder.trackSelection(this._selection);
return;
}
if (!this._isMovingDown && this._selection.startLineNumber === 1) {
this._selectionId = builder.trackSelection(this._selection);
return;
}
@@ -328,7 +331,7 @@ export class MoveLinesCommand implements ICommand {
}
public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {
let result = helper.getTrackedSelection(this._selectionId);
let result = helper.getTrackedSelection(this._selectionId!);
if (this._moveEndPositionDown) {
result = result.setEndPosition(result.endLineNumber + 1, 1);