-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a move command for the editor #9292
Conversation
@@ -1126,6 +1128,10 @@ export class Cursor extends EventEmitter { | |||
return this._invokeForAll(ctx, (cursorIndex: number, oneCursor: OneCursor, oneCtx: IOneCursorOperationContext) => OneCursorOp.moveTo(oneCursor, inSelectionMode, ctx.eventData.position, ctx.eventData.viewPosition, ctx.eventSource, oneCtx)); | |||
} | |||
|
|||
private _move(inSelectionMode:boolean, ctx: IMultipleCursorOperationContext): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inSelectionMode
should be added as a boolean argument accepted by the command. Not sure what name would be best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go for the same name 'inSelectionMode'.
@sandy081 I've reviewed |
@alexandrudima Thanks for the review. Incorporated the review feedback. Take a look. Thanks, |
@sandy081 LGTM |
Thanks @alexandrudima. Merging the PR. |
PR for #9143
Introduce a move command for placing cursor at a logical view position in the editor.
Usage:
cursorMove
{to: $viewPosition}
Allowed view positions:
lineStart
: Places the cursor at the start of the current line in the view.lineFirstNonWhitespaceCharacter
: Places the cursor at the first non white space character of the current line in the view.lineEnd
: Places the cursor at the end of the current line in the view.lineLastNonWhitespaceCharacter
: Places the cursor at the last non white space character of the current line in the view.lineCenter
: Places the cursor at the center of the line in the view.