mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 02:48:30 -05:00
Merge from vscode bead496a613e475819f89f08e9e882b841bc1fe8 (#14883)
* Merge from vscode bead496a613e475819f89f08e9e882b841bc1fe8 * Bump distro * Upgrade GCC to 4.9 due to yarn install errors * Update build image * Fix bootstrap base url * Bump distro * Fix build errors * Update source map file * Disable checkbox for blocking migration issues (#15131) * disable checkbox for blocking issues * wip * disable checkbox fixes * fix strings * Remove duplicate tsec command * Default to off for tab color if settings not present * re-skip failing tests * Fix mocha error * Bump sqlite version & fix notebooks search view * Turn off esbuild warnings * Update esbuild log level * Fix overflowactionbar tests * Fix ts-ignore in dropdown tests * cleanup/fixes * Fix hygiene * Bundle in entire zone.js module * Remove extra constructor param * bump distro for web compile break * bump distro for web compile break v2 * Undo log level change * New distro * Fix integration test scripts * remove the "no yarn.lock changes" workflow * fix scripts v2 * Update unit test scripts * Ensure ads-kerberos2 updates in .vscodeignore * Try fix unit tests * Upload crash reports * remove nogpu * always upload crashes * Use bash script * Consolidate data/ext dir names * Create in tmp directory Co-authored-by: chlafreniere <hichise@gmail.com> Co-authored-by: Christopher Suh <chsuh@microsoft.com> Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -39,11 +39,11 @@ export class MoveOperations {
|
||||
public static leftPositionAtomicSoftTabs(model: ICursorSimpleModel, lineNumber: number, column: number, tabSize: number): Position {
|
||||
const minColumn = model.getLineMinColumn(lineNumber);
|
||||
const lineContent = model.getLineContent(lineNumber);
|
||||
const newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, column - minColumn, tabSize, Direction.Left);
|
||||
if (newPosition === -1) {
|
||||
const newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, column - 1, tabSize, Direction.Left);
|
||||
if (newPosition === -1 || newPosition + 1 < minColumn) {
|
||||
return this.leftPosition(model, lineNumber, column);
|
||||
}
|
||||
return new Position(lineNumber, minColumn + newPosition);
|
||||
return new Position(lineNumber, newPosition + 1);
|
||||
}
|
||||
|
||||
public static left(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number): CursorPosition {
|
||||
@@ -81,13 +81,12 @@ export class MoveOperations {
|
||||
}
|
||||
|
||||
public static rightPositionAtomicSoftTabs(model: ICursorSimpleModel, lineNumber: number, column: number, tabSize: number, indentSize: number): Position {
|
||||
const minColumn = model.getLineMinColumn(lineNumber);
|
||||
const lineContent = model.getLineContent(lineNumber);
|
||||
const newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, column - minColumn, tabSize, Direction.Right);
|
||||
const newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, column - 1, tabSize, Direction.Right);
|
||||
if (newPosition === -1) {
|
||||
return this.rightPosition(model, lineNumber, column);
|
||||
}
|
||||
return new Position(lineNumber, minColumn + newPosition);
|
||||
return new Position(lineNumber, newPosition + 1);
|
||||
}
|
||||
|
||||
public static right(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number): CursorPosition {
|
||||
@@ -230,6 +229,47 @@ export class MoveOperations {
|
||||
);
|
||||
}
|
||||
|
||||
private static _isBlankLine(model: ICursorSimpleModel, lineNumber: number): boolean {
|
||||
if (model.getLineFirstNonWhitespaceColumn(lineNumber) === 0) {
|
||||
// empty or contains only whitespace
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static moveToPrevBlankLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {
|
||||
let lineNumber = cursor.position.lineNumber;
|
||||
|
||||
// If our current line is blank, move to the previous non-blank line
|
||||
while (lineNumber > 1 && this._isBlankLine(model, lineNumber)) {
|
||||
lineNumber--;
|
||||
}
|
||||
|
||||
// Find the previous blank line
|
||||
while (lineNumber > 1 && !this._isBlankLine(model, lineNumber)) {
|
||||
lineNumber--;
|
||||
}
|
||||
|
||||
return cursor.move(inSelectionMode, lineNumber, model.getLineMinColumn(lineNumber), 0);
|
||||
}
|
||||
|
||||
public static moveToNextBlankLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {
|
||||
const lineCount = model.getLineCount();
|
||||
let lineNumber = cursor.position.lineNumber;
|
||||
|
||||
// If our current line is blank, move to the next non-blank line
|
||||
while (lineNumber < lineCount && this._isBlankLine(model, lineNumber)) {
|
||||
lineNumber++;
|
||||
}
|
||||
|
||||
// Find the next blank line
|
||||
while (lineNumber < lineCount && !this._isBlankLine(model, lineNumber)) {
|
||||
lineNumber++;
|
||||
}
|
||||
|
||||
return cursor.move(inSelectionMode, lineNumber, model.getLineMinColumn(lineNumber), 0);
|
||||
}
|
||||
|
||||
public static moveToBeginningOfLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {
|
||||
let lineNumber = cursor.position.lineNumber;
|
||||
let minColumn = model.getLineMinColumn(lineNumber);
|
||||
|
||||
Reference in New Issue
Block a user