#2365 autoIndent aligns with javadoc *

minor bug
open
Damien
5
2012-01-18
2005-03-24
Dusty Phillips
No

If I'm typing a Java file, and I enter a Javadoc,
followed by a class or method declaration, when I press
<enter> on the line, it indents to the * on the
javadoc. Example:

I type:
<pre>
/**
* javadoc comment
*/
public class MyClass {
</pre>

Jedit automatically indents to:
<pre>
/**
* javadoc comment
*/
public class MyClass {
</pre>

inserting the space at the beginning of the line. This
is quite annoying.

Workaround:
comment out these two lines
<pre>
&lt;PROPERTY NAME="indentOpenBrackets" VALUE="{" /&gt;
&lt;PROPERTY NAME="indentCloseBrackets" VALUE="}" /&gt;
</pre>

in the java mode file. However, this disables the other
features of autoindent.

Dusty

Discussion

  • Robert Schwenn
    Robert Schwenn
    2007-02-08

    Logged In: YES
    user_id=1486645
    Originator: NO

    I can't see what You mean.
    I guess the text You typed has been re-formatted and has become unclear. HTML tags are not recognized here in the tracker.

     
  • Robert Schwenn
    Robert Schwenn
    2007-02-08

    Logged In: YES
    user_id=1486645
    Originator: NO

    Now, that I got this tracker item via Mail, there are some leading spaces to see:

    Original, there was leading spaces only before the javadoc. "public class MyClass " was typed without any leading spaces. But at the time I type "{" this line is indented like the preceeding javadoc. It's not expected, is it?.

    jEdit 4.2final and 4.3pre9
    java 1.5.0_10
    Windows XP SP2

     
  • Damien
    Damien
    2010-11-15

    This is an old bug, but one that I've also run into and am not sure how to classify. Technically speaking, it's not a bug; the indentation of each line is determined by that of the line before it, which results in the space being preserved.

    As far as I can tell, the only way to really fix this would be to change the indent behavior, by either forcing an alignment or by adding special support for comment headers. This might be a little difficult to do, though I'll probably look into it soon.

     
  • Alan Ezust
    Alan Ezust
    2012-01-18

    • assigned_to: nobody --> kog13