Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Automatic formatting tool(Why is the formatting tool ignoring double linebreaks?)
Automatic formatting tool [message #817770] Sat, 10 March 2012 16:27 Go to next message
Max Ekström is currently offline Max EkströmFriend
Messages: 1
Registered: March 2012
Junior Member
Hi!

I've been using Eclipse to develop programs in Java for a while now and I'm very pleased with it, but one thing I can't understand is the automatic formatting tool (Source->Format). I have coded in other languages before and in all of them (at least before I started coding Java) I formatted my code like this:
if(1 == 1)
{
   // do something
}

Then I discovered the formatting tool and of course it moved up all my curly start brackets one line. I found that you can change this in the preferences, but it was much easier for me to just accept this.
if(1 == 1) {
   // do something
}


Anyway to the thing I don't understand! How come it corrects my code above and leaves the following code untouched?
if(1 == 1)

{
   // do something
}


And you can add even more line breaks if you want to

if

(

1

==

1

)

{
   // do something
}


Seems like a really nice way to code! Smile But honestly, how come this isn't retracted?

[Updated on: Sat, 10 March 2012 16:29]

Report message to a moderator

Re: Automatic formatting tool [message #818789 is a reply to message #817770] Mon, 12 March 2012 05:35 Go to previous message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
That is because there are other options that impact this. You may want to look at the tab 'Line Wrapping'->Never join already wrapped lines and other options.
Previous Topic:Grabbing byte code from post editor reconcile
Next Topic:new request to create folders recursively when folder name is specified with the file separator
Goto Forum:
  


Current Time: Thu Apr 25 01:49:01 GMT 2024

Powered by FUDForum. Page generated in 0.03742 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top