vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

keep indention when insert next line only when necessary such as binary operators (like `-`, `+`, `*`, `%in%`, `%>%`)

Open Yunuuuu opened this issue 2 years ago • 3 comments

this is ccurrent implement

a <- b + # type `ENTER` to input next line, and next line won't have indention

a <- b +
    d + # type `ENTER` to input next line, and next line will have indention


a <- b +
    d # type `ENTER` to input next line, and next line will have indention even it's necessary to add indention

this is anticipated implement

a <- b + # type `ENTER` to input next line, and next line should have indention

a <- b +
    d + # type `ENTER` to input next line, and next line will have indention


a <- b +
    d # type `ENTER` to input next line, and next line shouldn't add indention

Yunuuuu avatar Mar 10 '22 03:03 Yunuuuu

It seems the current implement of indention for next line is based on current line indention

Yunuuuu avatar Mar 10 '22 03:03 Yunuuuu

I have tried to using this setting in vscode-R\language\r-configuration.json according to vscode document:

	"indentationRules": {
		"increaseIndentPattern": "(%.*%|[\\^+\\-*/<>=!&|~?])\\s*$",
		"indentNextLinePattern": "(%.*%|[\\^+\\-*/<>=!&|~?])\\s*$"
	}

but it didn't work, it's weird.

Yunuuuu avatar Mar 10 '22 11:03 Yunuuuu

Anyone made this working?

PMassicotte avatar Aug 05 '22 13:08 PMassicotte

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Aug 06 '23 01:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 21 '23 01:08 github-actions[bot]