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

delete call in API does not call autoClosingPairDelete #17490

Closed
xconverge opened this issue Dec 18, 2016 · 2 comments
Closed

delete call in API does not call autoClosingPairDelete #17490

xconverge opened this issue Dec 18, 2016 · 2 comments
Assignees
Labels
*as-designed Described behavior is as designed feature-request Request for new features or functionality

Comments

@xconverge
Copy link
Contributor

I am trying to invoke the autoClosingPairDelete function from the api

In the source code I see:

public static deleteLeft(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState): EditOperationResult {
let r = this.autoClosingPairDelete(config, model, cursor);

So then I call vscode.window.activeTextEditor.edit with an edit.delete for one char to the left. It does not seem that this snippet of code is executed.

Is there an API call to be able to use the autoClosingPairDelete functionality?

@kieferrm kieferrm added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Dec 19, 2016
@rebornix
Copy link
Member

Right now the function @xconverge mentioned is bind to command deleteLeft. When you press backspace in vanilla Code, Code will actually execute command deleteLeft. That's why TextEditorEdit.delete doesn't share the same logic.

@rebornix rebornix added editor feature-request Request for new features or functionality and removed *question Issue represents a question, should be posted to StackOverflow (VS Code) labels Dec 20, 2016
@jrieken jrieken assigned rebornix and alexdima and unassigned jrieken Dec 20, 2016
@alexdima
Copy link
Member

alexdima commented Mar 2, 2017

This is by design. Doing edits via textEditor.edit does not include any magic, it simply applies those edits.

@alexdima alexdima closed this as completed Mar 2, 2017
@alexdima alexdima added the *as-designed Described behavior is as designed label Mar 2, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants