History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-19328
Type: Bug Bug
Status: Open Open
Assignee: Olesya Smirnova
Reporter: Christian Nelson
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

"Simple blocks on one line" and "Force braces" aren't applied ideally

Created: 26 Aug 08 21:26   Updated: 26 Aug 08 21:32
Component/s: Code Formatting and Code Style

File Attachments: 1. Zip Archive code-formatting-bug.zip (8 kb)

Image Attachments:

1. actual-formatting.jpg
(41 kb)

2. code-before-formatting.jpg
(38 kb)

3. expected-formatting.jpg
(39 kb)
Environment: Windows Xp

Build: 7,941
Severity: Medium


 Description  « Hide
When both "Simple blocks on one line" and "Force braces" are both enabled, single line "simple blocks" are initially switched to multi-line blocks.

Given:

if (x > y) System.out.println("foo!");

Is formatted to:

if (x > y)
{
    System.out.println("foo!");
}

When this is expected:

if (x > y) { System.out.println("foo!"); }

If the statement was a simple one-line block before adding braces, I would think it should remain one after the braces have been added. It would improve usability if we didn't have to manually change these lines back to single-line simple blocks after formatting.

I've attached several screen shots and a simple project with code formatting settings included.

This affects both v7.0.4 and v8.0M1 and this is related to IDEA-19321.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.