use 'value' instead of 'amount'
This commit is contained in:
parent
85bb5a1ef7
commit
0ddfe2ba39
|
@ -680,13 +680,13 @@ export class OneCursorOp {
|
|||
let inSelectionMode = !!moveParams.select;
|
||||
let validatedViewPosition = cursor.getValidViewPosition();
|
||||
let viewLineNumber = validatedViewPosition.lineNumber;
|
||||
let noOfLines = moveParams.isPaged ? (moveParams.pageSize || cursor.getPageSize()) : moveParams.amount;
|
||||
let noOfLines = moveParams.isPaged ? (moveParams.pageSize || cursor.getPageSize()) : moveParams.value;
|
||||
let viewColumn;
|
||||
switch (moveParams.to) {
|
||||
case editorCommon.CursorMovePosition.Left:
|
||||
return this.moveLeft(cursor, inSelectionMode, editorCommon.CursorMoveByUnit.HalfLine === moveParams.by ? cursor.getViewHalfLineSize(viewLineNumber) : moveParams.amount, ctx);
|
||||
return this.moveLeft(cursor, inSelectionMode, editorCommon.CursorMoveByUnit.HalfLine === moveParams.by ? cursor.getViewHalfLineSize(viewLineNumber) : moveParams.value, ctx);
|
||||
case editorCommon.CursorMovePosition.Right:
|
||||
return this.moveRight(cursor, inSelectionMode, editorCommon.CursorMoveByUnit.HalfLine === moveParams.by ? cursor.getViewHalfLineSize(viewLineNumber) : moveParams.amount, ctx);
|
||||
return this.moveRight(cursor, inSelectionMode, editorCommon.CursorMoveByUnit.HalfLine === moveParams.by ? cursor.getViewHalfLineSize(viewLineNumber) : moveParams.value, ctx);
|
||||
case editorCommon.CursorMovePosition.Up:
|
||||
if (editorCommon.CursorMoveByUnit.WrappedLine === moveParams.by) {
|
||||
return this.moveUp(cursor, inSelectionMode, noOfLines, ctx);
|
||||
|
@ -713,11 +713,11 @@ export class OneCursorOp {
|
|||
viewColumn = cursor.getViewLineLastNonWhiteSpaceColumn(viewLineNumber);
|
||||
break;
|
||||
case editorCommon.CursorMovePosition.ViewPortTop:
|
||||
viewLineNumber = cursor.convertModelPositionToViewPosition(cursor.getLineFromViewPortTop(moveParams.amount), 1).lineNumber;
|
||||
viewLineNumber = cursor.convertModelPositionToViewPosition(cursor.getLineFromViewPortTop(moveParams.value), 1).lineNumber;
|
||||
viewColumn = cursor.getViewLineFirstNonWhiteSpaceColumn(viewLineNumber);
|
||||
break;
|
||||
case editorCommon.CursorMovePosition.ViewPortBottom:
|
||||
viewLineNumber= cursor.convertModelPositionToViewPosition(cursor.getLineFromViewPortBottom(moveParams.amount), 1).lineNumber;;
|
||||
viewLineNumber= cursor.convertModelPositionToViewPosition(cursor.getLineFromViewPortBottom(moveParams.value), 1).lineNumber;;
|
||||
viewColumn = cursor.getViewLineFirstNonWhiteSpaceColumn(viewLineNumber);
|
||||
break;
|
||||
case editorCommon.CursorMovePosition.ViewPortCenter:
|
||||
|
|
|
@ -4227,7 +4227,7 @@ export interface CursorMoveArguments {
|
|||
to: string;
|
||||
select?: boolean;
|
||||
by?: string;
|
||||
amount?: number;
|
||||
value?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -4252,7 +4252,7 @@ let isCursorMoveArgs= function(arg): boolean {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!types.isUndefined(cursorMoveArg.amount) && !types.isNumber(cursorMoveArg.amount)) {
|
||||
if (!types.isUndefined(cursorMoveArg.value) && !types.isNumber(cursorMoveArg.value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -476,24 +476,24 @@ function moveToLineLastNonWhiteSpaceCharacter(cursor: Cursor) {
|
|||
move(cursor, {to: CursorMovePosition.WrappedLineLastNonWhitespaceCharacter});
|
||||
}
|
||||
|
||||
function moveLeft(cursor: Cursor, amount?: number, by?: string, select?: boolean) {
|
||||
move(cursor, {to: CursorMovePosition.Left, by:by, amount: amount, select: select});
|
||||
function moveLeft(cursor: Cursor, value?: number, by?: string, select?: boolean) {
|
||||
move(cursor, {to: CursorMovePosition.Left, by:by, value: value, select: select});
|
||||
}
|
||||
|
||||
function moveRight(cursor: Cursor, amount?: number, by?: string, select?: boolean) {
|
||||
move(cursor, {to: CursorMovePosition.Right, by:by, amount: amount, select: select});
|
||||
function moveRight(cursor: Cursor, value?: number, by?: string, select?: boolean) {
|
||||
move(cursor, {to: CursorMovePosition.Right, by:by, value: value, select: select});
|
||||
}
|
||||
|
||||
function moveUp(cursor: Cursor, noOfLines: number= 1, select?: boolean) {
|
||||
move(cursor, {to: CursorMovePosition.Up, by:CursorMoveByUnit.WrappedLine, amount: noOfLines, select: select});
|
||||
move(cursor, {to: CursorMovePosition.Up, by:CursorMoveByUnit.WrappedLine, value: noOfLines, select: select});
|
||||
}
|
||||
|
||||
function moveDown(cursor: Cursor, noOfLines: number= 1, select?: boolean) {
|
||||
move(cursor, {to: CursorMovePosition.Down, by:CursorMoveByUnit.WrappedLine, amount: noOfLines, select: select});
|
||||
move(cursor, {to: CursorMovePosition.Down, by:CursorMoveByUnit.WrappedLine, value: noOfLines, select: select});
|
||||
}
|
||||
|
||||
function moveToTop(cursor: Cursor, noOfLines: number= 1, select?: boolean) {
|
||||
move(cursor, {to: CursorMovePosition.ViewPortTop, amount: noOfLines, select: select});
|
||||
move(cursor, {to: CursorMovePosition.ViewPortTop, value: noOfLines, select: select});
|
||||
}
|
||||
|
||||
function moveToCenter(cursor: Cursor, select?: boolean) {
|
||||
|
@ -501,7 +501,7 @@ function moveToCenter(cursor: Cursor, select?: boolean) {
|
|||
}
|
||||
|
||||
function moveToBottom(cursor: Cursor, noOfLines: number= 1, select?: boolean) {
|
||||
move(cursor, {to: CursorMovePosition.ViewPortBottom, amount: noOfLines, select: select});
|
||||
move(cursor, {to: CursorMovePosition.ViewPortBottom, value: noOfLines, select: select});
|
||||
}
|
||||
|
||||
function cursorEqual(cursor: Cursor, posLineNumber: number, posColumn: number, selLineNumber: number = posLineNumber, selColumn: number = posColumn) {
|
||||
|
|
2
src/vs/monaco.d.ts
vendored
2
src/vs/monaco.d.ts
vendored
|
@ -3234,7 +3234,7 @@ declare module monaco.editor {
|
|||
to: string;
|
||||
select?: boolean;
|
||||
by?: string;
|
||||
amount?: number;
|
||||
value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue