Bug 180958 - Add Support for indented braces
Summary: Add Support for indented braces
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.2   Edit
Hardware: All Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-04 10:34 EDT by Bobby Skinner CLA
Modified: 2007-05-03 20:55 EDT (History)
0 users

See Also:


Attachments
Screen shot of settings (536.08 KB, image/tiff)
2007-04-23 16:51 EDT, Bobby Skinner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bobby Skinner CLA 2007-04-04 10:34:34 EDT
I would like to add support for my coding style in the editor. I would like to have the curly braces indented like this:

	private JTextField getCounter()
	        {
		if (counter == null)
		        {
			counter = new JTextField();
			counter.setSize(new Dimension(336, 22));
		        }
		return counter;
	        }

currently the closest I can achieve is like this:

	private JTextField getCounter()
	{
		if (counter == null)
		{
			counter = new JTextField();
			counter.setSize(new Dimension(336, 22));
		}
		return counter;
	}

I realize that my style is not the most popular, but I have been using it for 20 years and prefer it. It seems with all the flexibility the the IDE supports that this one item would not be a big deal.
Comment 1 Dani Megert CLA 2007-04-23 16:23:10 EDT
Do you mean by the formatter or while typing?
Can you configure the formatter to match your style?
Comment 2 Bobby Skinner CLA 2007-04-23 16:51:24 EDT
Created attachment 64655 [details]
Screen shot of settings
Comment 3 Bobby Skinner CLA 2007-04-23 16:52:03 EDT
I did not see a way to configure it to operate this way. I was meaning the format as you type options. The closest I could get formated with the braces not indented, this means that I have to go back and manually change them after I enter them.

If it is possible to achieve this kind of automatic formatting is achievable, please describe which settings to set to do this. I will attach a screen shot showing the issue.

I am sorry if I am just unfamiliar with it and missed the option. I have just started to use eclipse as our new IDE is built around it. But I still use slickedit most of the time but eclipse is good enough that I may switch to it once I figure it out completely.
Comment 4 Dani Megert CLA 2007-04-24 02:38:12 EDT
We use the formatter prefs for auto-indenting i.e. we first need this being supported by the formatter. Moving to JDT Core.
Comment 5 Olivier Thomann CLA 2007-04-24 11:00:48 EDT
The brace setting "Next line indented" is exactly what you are looking for.
Comment 6 Olivier Thomann CLA 2007-04-24 11:01:12 EDT
Closing as INVALID.
Comment 7 Olivier Thomann CLA 2007-05-03 20:55:28 EDT
Verify for 3.3M7 with I20070503-1400.