Menu

#372 Java indenting

open
Edit mode (24)
5
2011-12-06
2010-09-03
Damien
No

When writing a method with parameters spanning multiple lines, jEdit indents strangely if you try to put the opening bracket on the same line. It would be great if jEdit implemented eclipse's style of java indenting, which is basically:

When a newline is added after a method parameter, double-indent the next line. If the bracket is put on the same line, keep the indentation and un-indent the next line by one so it ends up indented normally from the start of the declaration. If the bracket is put on a new line, undo the double-indent so that the bracket lines up with the start of the declaration, and then indent normally from there.

Is there a way to implement this in the current edit mode, or would something need to be added to the core to let this work?

Discussion

  • Dale Anson

    Dale Anson - 2010-09-03

    This sort of thing is on my list to do for the Beauty plugin. Right now, Beauty formats java code pretty close to the Sun standard. My intent is to add several other predefined styles similar to those provided by AStyle, and provide option settings for each of these.

     
  • Damien

    Damien - 2010-09-04

    The beautifier wouldn't be as dynamic as built-in support, and jEdit's default indenting in this scenario is really hard to work with. It would be nice to have a beautifier ensure that multi-line parameter lists end with a same-line bracket if desired, but I still think it should be implemented in the edit mode.

     
  • Alan Ezust

    Alan Ezust - 2011-12-06
    • assigned_to: nobody --> daleanson
     

Log in to post a comment.