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

[C/C++] remove switch case auto unindent #3960

Open
StreetwareGames opened this issue Apr 21, 2024 · 1 comment
Open

[C/C++] remove switch case auto unindent #3960

StreetwareGames opened this issue Apr 21, 2024 · 1 comment

Comments

@StreetwareGames
Copy link

StreetwareGames commented Apr 21, 2024

Expected behavior

Don't unindent when you type case

Actual behavior

every time you type case, it auto unindents and you end up with each next case being less indented than the previous. No other editor that I'm aware of does this.

Steps to reproduce

2024-04-2111-24-34-ezgif.com-crop-video.mp4
@deathaxe
Copy link
Collaborator

Indentation rules work on a per-line basis using regular expressions.
Only a single style of indentation can be supported at a time.

The intended style is:

void main(int argc) {
	switch(argc) {
	case 1:
		// statements
		break;
	
	case 2:
		{
			// statements
		}
		break;

	default:
		// statements
		break
	}
}

The way of using brackets directly after case seems rather uncommon.

Anything else requires customization on users end.

It is not currently planned to change the defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants