mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-19 03:21:36 -04:00
Merge from vscode 52dcb723a39ae75bee1bd56b3312d7fcdc87aeed (#6719)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user