-
Notifications
You must be signed in to change notification settings - Fork 0
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
[CLOSED] Auto-Identation and Switch Statements #1302
Comments
Comment by pthiess Reviewed - Move to backlog - card 379. |
Comment by peterflynn I get 2 tabs after both closing curly braces instead of 3, if this is the only text in the file. This is a CodeMirror bug that repros outside of Brackets as well. I've filed codemirror/codemirror5#708 to track it. |
Comment by peterflynn Looks like the CodeMirror bug has been fixed. It might be a while before we can merge though, since there's been a lot of churn in the scrolling code lately. |
Comment by jdiehl This works on CodeMirror.net, so I guess it is fixed. Thanks for forwarding this. |
Comment by peterflynn Reopening -- this won't be fixed in Brackets until we integrate a newer version of CodeMirror |
Comment by pthiess Marked low priority |
Comment by njx The worst of this appears to be fixed now that cmv3 is merged--the indentation doesn't "march inward"--but the indentation level of the case statement is too high (it gets indented two tabs worth instead of one, at least when spaces are on). Assigning to me |
Comment by njx Filed codemirror/codemirror5#1592 on the latter issue. |
Comment by fdecampredon This is due to the overriding of electricChars on the Editor. |
Comment by njx Low pri but nominating for Brackets 1.0 - it looks like a fix should be possible or easy now (an option was added to CM, and also there's |
Comment by njx Reviewed. Timebox to half hour. |
Comment by peterflynn Unfortunately the CM flag added in codemirror/codemirror5#1592 doesn't really help the issue -- it just makes CM insist on intending It sounds like the real fix is to have
|
Comment by peterflynn It also still seems like a bug in CM that the initial line after |
Comment by dangoor Remove 1.1 milestone. We'll take another look at this when we review Marcel's pull request. |
Comment by prafulVaishnav Fixed by PR #9387 Closing it. |
Issue by jdiehl
Wednesday Aug 01, 2012 at 09:39 GMT
Originally opened as adobe/brackets#1324
I noticed that the auto-indentation seems to be confused after switch statements. Consider the following (JSLint-approved) code:
When hitting enter after the first closing }, auto-indentation inserts 3 tabs (1 would be correct).
When hitting enter after the second closing }, auto-indentation again inserts 3 tabs (0 would be correct).
This goes on, even if additional functions, scopes, whatever are defined, auto-indentation always adds 3 tabs.
The text was updated successfully, but these errors were encountered: