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

[javascript mode] Indentation wrong inside switch statement #1592

Closed
njx opened this issue Jun 12, 2013 · 1 comment
Closed

[javascript mode] Indentation wrong inside switch statement #1592

njx opened this issue Jun 12, 2013 · 1 comment

Comments

@njx
Copy link
Contributor

njx commented Jun 12, 2013

  1. Open demo/theme.html
  2. At the end of the file, type switch (foo) { and hit Return

Result: cursor is indented 4 spaces
Expected: cursor should be indented 2 spaces, as in other block statements like if and for

@marijnh
Copy link
Member

marijnh commented Jun 12, 2013

This is intentional (lines with case or default on them will be indented once, others inside a switch body are indented twice). I've added a mode option doubleIndentSwitch in the attached patch that can be used to turn this behaviour off (set to false).

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