Summary: Web Inspector: JS PrettyPrinting - multiline if conditions should be indented Input: if (a || b || c) { true; } Expected Output: if (a || b || c) { true; } Actual Output: if (a || b || c) { true; } Notes: - The if statement's header (if (...)) should be indented in case it is multi-line (based on user's original formatting).
<rdar://problem/29446537>
IMO, this would be perfect for an item in the Settings tab. Personally, I write my code to look exactly like the actual output, so I'd like to have the option to keep it like that. Maybe something along the lines of "Match Indent of Multi-Line if with First Line" ¯\_(ツ)_/¯
(In reply to comment #2) > IMO, this would be perfect for an item in the Settings tab. Personally, I > write my code to look exactly like the actual output, so I'd like to have > the option to keep it like that. Maybe something along the lines of "Match > Indent of Multi-Line if with First Line" ¯\_(ツ)_/¯ This would be too obscure on its own. Potentially if we had settings for other editing / formatting behaviors then it could be included in a group. This formatting suggestion matches CodeMirror behavior, and WebKit style <https://webkit.org/code-style-guidelines/#indentation-wrap-bool-op> which is what we typically make our pretty printer do.