-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Auto-Identation and Switch Statements #1324
Comments
Reviewed - Move to backlog - card 379. |
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. |
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. @jdiehl, do you want to verify the fix upstream in the meantime? |
This works on CodeMirror.net, so I guess it is fixed. Thanks for forwarding this. |
Reopening -- this won't be fixed in Brackets until we integrate a newer version of CodeMirror |
Marked low priority |
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 |
Filed codemirror/codemirror5#1592 on the latter issue. |
This is due to the overriding of electricChars on the Editor. |
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 @fdecampredon's note). |
Reviewed. Timebox to half hour. |
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
|
It also still seems like a bug in CM that the initial line after |
Remove 1.1 milestone. We'll take another look at this when we review Marcel's pull request. |
Fixed by PR #9387 Closing it. |
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: