It would be nice to have the option of using different
indenting styles. DrJava seems to be set up for the K
& R style, where the braces are NOT lined up vertically
(as shown below).
public class SomeClass {
//stuff
}
However, many introductory texts recommend lining them
up as shown below.
public class SomeClass
{
//stuff
}
or even
public class SomeClass
{ //stuff
}
I'd even settle for a system that didn't try to guess
how you wanted indentations, but remembered the last
indent level and stuck with it until you changed it.
Logged In: YES
user_id=429731
The first two styles you mention should work currently
without a problem (putting the brace on a line by itself
doesn't change our current rules), but flexibility can be
good. And actually, it should be fairly trivial to drop in
alternative indent styles, given the way the code is written.
We'll probably look into this in the spring semester.
Your last suggestion (keep previous indent level) would
probably be useful for non-code files, too (see feature
request 571805). Thanks for the suggestion...
Charlie
Logged In: YES
user_id=666354
I'm a little embarrassed. Whenever I tried the second
method, the editor indented two spaces after I hit enter, so
I just backed up and switched to the K&R style. I never
actually put in the opening brace on the next line. Had I
done that, I'd have seen that the editor would unindent the
line by itself to put the brace in the correct position.
Not the behavior I was expecting, but it works!
thanks
tom
cowderyt@district87.org
Logged In: YES
user_id=666354
I'm a little embarrassed. Whenever I tried the second
method, the editor indented two spaces after I hit enter, so
I just backed up and switched to the K&R style. I never
actually put in the opening brace on the next line. Had I
done that, I'd have seen that the editor would unindent the
line by itself to put the brace in the correct position.
Not the behavior I was expecting, but it works!
thanks
tom
cowderyt@district87.org
Logged In: YES
user_id=666354
I'm a little embarrassed. Whenever I tried the second
method, the editor indented two spaces after I hit enter, so
I just backed up and switched to the K&R style. I never
actually put in the opening brace on the next line. Had I
done that, I'd have seen that the editor would unindent the
line by itself to put the brace in the correct position.
Not the behavior I was expecting, but it works!
thanks
tom
cowderyt@district87.org