Skip to content
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

Merged
merged 4 commits into from
Jul 18, 2016
Merged

Conversation

sandy081
Copy link
Member

@sandy081 sandy081 commented Jul 14, 2016

PR for #9143

Introduce a move command for placing cursor at a logical view position in the editor.

Usage:

  • Command Id: cursorMove
  • Arguments: {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.

@sandy081 sandy081 added this to the July 2016 milestone Jul 14, 2016
@sandy081 sandy081 added api VIM VIM issue feature-request Request for new features or functionality labels Jul 14, 2016
@@ -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 {
Copy link
Member

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.

Copy link
Member Author

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'.

@alexdima
Copy link
Member

alexdima commented Jul 15, 2016

@sandy081 I've reviewed

@sandy081
Copy link
Member Author

@alexandrudima Thanks for the review. Incorporated the review feedback. Take a look. Thanks,

@alexdima
Copy link
Member

@sandy081 LGTM

@sandy081
Copy link
Member Author

Thanks @alexandrudima. Merging the PR.

@sandy081 sandy081 merged commit f39db00 into master Jul 18, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality VIM VIM issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants