diff --git a/src/vs/editor/common/controller/cursorWordOperations.ts b/src/vs/editor/common/controller/cursorWordOperations.ts index 13acacc4cbe2d..0ab6c93132691 100644 --- a/src/vs/editor/common/controller/cursorWordOperations.ts +++ b/src/vs/editor/common/controller/cursorWordOperations.ts @@ -163,11 +163,9 @@ export class WordOperations { public static moveWordLeft(wordSeparators: WordCharacterClassifier, model: ICursorSimpleModel, position: Position, wordNavigationType: WordNavigationType): Position { let lineNumber = position.lineNumber; let column = position.column; - let movedToPreviousLine = false; if (column === 1) { if (lineNumber > 1) { - movedToPreviousLine = true; lineNumber = lineNumber - 1; column = model.getLineMaxColumn(lineNumber); } @@ -176,17 +174,6 @@ export class WordOperations { let prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new Position(lineNumber, column)); if (wordNavigationType === WordNavigationType.WordStart) { - - if (prevWordOnLine && !movedToPreviousLine) { - // Special case for Visual Studio compatibility: - // when starting in the trim whitespace at the end of a line, - // go to the end of the last word - const lastWhitespaceColumn = model.getLineLastNonWhitespaceColumn(lineNumber); - if (lastWhitespaceColumn < column) { - return new Position(lineNumber, prevWordOnLine.end + 1); - } - } - return new Position(lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); } diff --git a/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts b/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts index ee38c0c8146f4..eadfa9ed3d885 100644 --- a/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts +++ b/src/vs/editor/contrib/wordOperations/test/wordOperations.test.ts @@ -167,7 +167,7 @@ suite('WordOperations', () => { test('cursorWordStartLeft', () => { // This is the behaviour observed in Visual Studio, please do not touch test - const EXPECTED = ['| |/* |Just |some |more |text |a|+= |3 |+|5|-|3 |+ |7 |*/| '].join('\n'); + const EXPECTED = ['| |/* |Just |some |more |text |a|+= |3 |+|5|-|3 |+ |7 |*/ '].join('\n'); const [text,] = deserializePipePositions(EXPECTED); const actualStops = testRepeatedActionAndExtractPositions( text,