sreenivas
sreenivas

Reputation: 2247

vscode: Api call for inserting newline respecting the indentation

I am looking for vscode API call for inserting newline respecting the indentation

enter image description here

Something like this... vscode.commands.executeCommand("cursorDown"); // this just puts the cursor in the next line

Upvotes: 0

Views: 606

Answers (1)

HaaLeo
HaaLeo

Reputation: 11692

You can use the editor.action.insertLineAfter command. I tried it with the command palette using vscode 1.22.2 and it does what your gif shows.

Upvotes: 2

Related Questions