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

[JS] should indent switch block 1 space unit, not two #2812

Closed
marcelgerber opened this issue Sep 18, 2014 · 2 comments
Closed

[JS] should indent switch block 1 space unit, not two #2812

marcelgerber opened this issue Sep 18, 2014 · 2 comments

Comments

@marcelgerber
Copy link
Contributor

  1. Go to http://codemirror.net/mode/javascript/index.html
  2. Type switch (foo) {, then press Enter

Result:
The following line is indented 2 space units (4 spaces in this demo)

Expected:
The following line is indented 1 space unit (2 spaces in this demo)

@marijnh
Copy link
Member

marijnh commented Sep 18, 2014

This is a matter of taste. My style, in which I'm definitely not alone, is to indent non case/default lines two units, and case/default lines a single unit. If you want to submit a patch to make this behavior configurable, I'd be okay with that.

@marcelgerber
Copy link
Contributor Author

Argh, I didn't get that writing case: back-indents a unit, so everything is fine.
I do still prefer one unit in the whole block, but that's not too much an issue.

Closing.

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

No branches or pull requests

2 participants