Author Topic: Javadoc formatting weirdness  (Read 4994 times)

dunkers

  • Senior Community Member
  • Posts: 778
  • Hero Points: 36
Javadoc formatting weirdness
« on: August 16, 2009, 07:16:56 PM »
I can't find the exact cause of this but have managed to reduce it to the following .h file:

Code: [Select]
#ifndef _TEST_H_
#define _TEST_H_

#include "test.h"
//=====================================================================================



//=====================================================================================
#endif /* _TEST_H_ */

At the mid-line between the two comment lines, I want to start a doc comment so I hit forward slash, star, star and then return:

Code: [Select]
#ifndef _TEST_H_
#define _TEST_H_

#include "test.h"
//=====================================================================================

/**
 * |
 */

//=====================================================================================
#endif /* _TEST_H_ */

The '|' character shows where the cursor is now position. I start typing the comment, maybe leading with a 'D' and expect it just to accept my typing as normal, but instead the first star on the line moves to column 1 and another star appears at the end of the line:

Code: [Select]
#ifndef _TEST_H_
#define _TEST_H_

#include "test.h"
//=====================================================================================

/**
*  D   *
 */

//=====================================================================================
#endif /* _TEST_H_ */

Unfortunately, this forum seems to have swallowed the line ending star, but it does exist at column 79. Weird.

If I remove the #include or #if or comment lines then this doesn't occur and a normal doc comment can be used.

David_O

  • Senior Community Member
  • Posts: 152
  • Hero Points: 8
Re: Javadoc formatting weirdness
« Reply #1 on: August 18, 2009, 04:15:48 PM »
I think that I know what is happening.  I'm betting that you have Automatic width selected for Comment Wrap, and an asterisk on the right for your comment borders.

But I really need to know what all your settings are for both Comments and Comment Wrap.

Thank you.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Javadoc formatting weirdness
« Reply #2 on: August 18, 2009, 04:34:47 PM »
FWIW, every once in a while for me the comment formatting gets confused and tries to put asterisk borders on the right even though the settings say not to (or I believe I've seen it forcibly end every line with a period, too) (and the first time I saw it was in the first few days of using SE12, while I was still using a stock install, so I know it's not due to any of my changes ;)).  It happens to me only rarely, so I haven't tracked down a repro, and haven't debugged to find the cause.

dunkers

  • Senior Community Member
  • Posts: 778
  • Hero Points: 36
Re: Javadoc formatting weirdness
« Reply #3 on: August 18, 2009, 04:53:47 PM »
@david_o: I've attached an options export for my entire C/C++ settings. If this isn't suitable let me know and I'll do a bunch of screen caps instead.

David_O

  • Senior Community Member
  • Posts: 152
  • Hero Points: 8
Re: Javadoc formatting weirdness
« Reply #4 on: August 18, 2009, 06:50:53 PM »
Thank you.  I was able to import and see the settings.  I now get exactly what you described.

-David-

dunkers

  • Senior Community Member
  • Posts: 778
  • Hero Points: 36
Re: Javadoc formatting weirdness
« Reply #5 on: August 19, 2009, 10:20:10 AM »
Cool. Whoever did the options import/export should get a ++ ;)