Skip to content

Commit 0ddfe2b

Browse files
committed
use 'value' instead of 'amount'
1 parent 85bb5a1 commit 0ddfe2b

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/vs/editor/common/controller/oneCursor.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,13 @@ export class OneCursorOp {
680680
let inSelectionMode = !!moveParams.select;
681681
let validatedViewPosition = cursor.getValidViewPosition();
682682
let viewLineNumber = validatedViewPosition.lineNumber;
683-
let noOfLines = moveParams.isPaged ? (moveParams.pageSize || cursor.getPageSize()) : moveParams.amount;
683+
let noOfLines = moveParams.isPaged ? (moveParams.pageSize || cursor.getPageSize()) : moveParams.value;
684684
let viewColumn;
685685
switch (moveParams.to) {
686686
case editorCommon.CursorMovePosition.Left:
687-
return this.moveLeft(cursor, inSelectionMode, editorCommon.CursorMoveByUnit.HalfLine === moveParams.by ? cursor.getViewHalfLineSize(viewLineNumber) : moveParams.amount, ctx);
687+
return this.moveLeft(cursor, inSelectionMode, editorCommon.CursorMoveByUnit.HalfLine === moveParams.by ? cursor.getViewHalfLineSize(viewLineNumber) : moveParams.value, ctx);
688688
case editorCommon.CursorMovePosition.Right:
689-
return this.moveRight(cursor, inSelectionMode, editorCommon.CursorMoveByUnit.HalfLine === moveParams.by ? cursor.getViewHalfLineSize(viewLineNumber) : moveParams.amount, ctx);
689+
return this.moveRight(cursor, inSelectionMode, editorCommon.CursorMoveByUnit.HalfLine === moveParams.by ? cursor.getViewHalfLineSize(viewLineNumber) : moveParams.value, ctx);
690690
case editorCommon.CursorMovePosition.Up:
691691
if (editorCommon.CursorMoveByUnit.WrappedLine === moveParams.by) {
692692
return this.moveUp(cursor, inSelectionMode, noOfLines, ctx);
@@ -713,11 +713,11 @@ export class OneCursorOp {
713713
viewColumn = cursor.getViewLineLastNonWhiteSpaceColumn(viewLineNumber);
714714
break;
715715
case editorCommon.CursorMovePosition.ViewPortTop:
716-
viewLineNumber = cursor.convertModelPositionToViewPosition(cursor.getLineFromViewPortTop(moveParams.amount), 1).lineNumber;
716+
viewLineNumber = cursor.convertModelPositionToViewPosition(cursor.getLineFromViewPortTop(moveParams.value), 1).lineNumber;
717717
viewColumn = cursor.getViewLineFirstNonWhiteSpaceColumn(viewLineNumber);
718718
break;
719719
case editorCommon.CursorMovePosition.ViewPortBottom:
720-
viewLineNumber= cursor.convertModelPositionToViewPosition(cursor.getLineFromViewPortBottom(moveParams.amount), 1).lineNumber;;
720+
viewLineNumber= cursor.convertModelPositionToViewPosition(cursor.getLineFromViewPortBottom(moveParams.value), 1).lineNumber;;
721721
viewColumn = cursor.getViewLineFirstNonWhiteSpaceColumn(viewLineNumber);
722722
break;
723723
case editorCommon.CursorMovePosition.ViewPortCenter:

src/vs/editor/common/editorCommon.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4227,7 +4227,7 @@ export interface CursorMoveArguments {
42274227
to: string;
42284228
select?: boolean;
42294229
by?: string;
4230-
amount?: number;
4230+
value?: number;
42314231
};
42324232

42334233
/**
@@ -4252,7 +4252,7 @@ let isCursorMoveArgs= function(arg): boolean {
42524252
return false;
42534253
}
42544254

4255-
if (!types.isUndefined(cursorMoveArg.amount) && !types.isNumber(cursorMoveArg.amount)) {
4255+
if (!types.isUndefined(cursorMoveArg.value) && !types.isNumber(cursorMoveArg.value)) {
42564256
return false;
42574257
}
42584258

src/vs/editor/test/common/controller/cursorMoveCommand.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -476,32 +476,32 @@ function moveToLineLastNonWhiteSpaceCharacter(cursor: Cursor) {
476476
move(cursor, {to: CursorMovePosition.WrappedLineLastNonWhitespaceCharacter});
477477
}
478478

479-
function moveLeft(cursor: Cursor, amount?: number, by?: string, select?: boolean) {
480-
move(cursor, {to: CursorMovePosition.Left, by:by, amount: amount, select: select});
479+
function moveLeft(cursor: Cursor, value?: number, by?: string, select?: boolean) {
480+
move(cursor, {to: CursorMovePosition.Left, by:by, value: value, select: select});
481481
}
482482

483-
function moveRight(cursor: Cursor, amount?: number, by?: string, select?: boolean) {
484-
move(cursor, {to: CursorMovePosition.Right, by:by, amount: amount, select: select});
483+
function moveRight(cursor: Cursor, value?: number, by?: string, select?: boolean) {
484+
move(cursor, {to: CursorMovePosition.Right, by:by, value: value, select: select});
485485
}
486486

487487
function moveUp(cursor: Cursor, noOfLines: number= 1, select?: boolean) {
488-
move(cursor, {to: CursorMovePosition.Up, by:CursorMoveByUnit.WrappedLine, amount: noOfLines, select: select});
488+
move(cursor, {to: CursorMovePosition.Up, by:CursorMoveByUnit.WrappedLine, value: noOfLines, select: select});
489489
}
490490

491491
function moveDown(cursor: Cursor, noOfLines: number= 1, select?: boolean) {
492-
move(cursor, {to: CursorMovePosition.Down, by:CursorMoveByUnit.WrappedLine, amount: noOfLines, select: select});
492+
move(cursor, {to: CursorMovePosition.Down, by:CursorMoveByUnit.WrappedLine, value: noOfLines, select: select});
493493
}
494494

495495
function moveToTop(cursor: Cursor, noOfLines: number= 1, select?: boolean) {
496-
move(cursor, {to: CursorMovePosition.ViewPortTop, amount: noOfLines, select: select});
496+
move(cursor, {to: CursorMovePosition.ViewPortTop, value: noOfLines, select: select});
497497
}
498498

499499
function moveToCenter(cursor: Cursor, select?: boolean) {
500500
move(cursor, {to: CursorMovePosition.ViewPortCenter, select: select});
501501
}
502502

503503
function moveToBottom(cursor: Cursor, noOfLines: number= 1, select?: boolean) {
504-
move(cursor, {to: CursorMovePosition.ViewPortBottom, amount: noOfLines, select: select});
504+
move(cursor, {to: CursorMovePosition.ViewPortBottom, value: noOfLines, select: select});
505505
}
506506

507507
function cursorEqual(cursor: Cursor, posLineNumber: number, posColumn: number, selLineNumber: number = posLineNumber, selColumn: number = posColumn) {

src/vs/monaco.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3234,7 +3234,7 @@ declare module monaco.editor {
32343234
to: string;
32353235
select?: boolean;
32363236
by?: string;
3237-
amount?: number;
3237+
value?: number;
32383238
}
32393239

32403240
/**

0 commit comments

Comments
 (0)