This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hi, I have some troubles with code autoformat with Source -> Format. When I use Alt+Shift+F with code where many preprocess symbols IDE can move defines (such as //#if TRALALA) to the end of the previous line. Not good. For example: - before Alt+Shift+F we have: public static final int DIALOG_BORDER_SIZE = 2, //#if ADJUST_DIALOG_BORDER_SPACE //# DIALOG_BORDER_SPACE = Constant.DIALOG_BORDER_SPACE, //#else DIALOG_BORDER_SPACE = 8, //#endif - and after Alt+Shift+F we have: public static final int DIALOG_BORDER_SIZE = 2, //#if ADJUST_DIALOG_BORDER_SPACE //# DIALOG_BORDER_SPACE = Constant.DIALOG_BORDER_SPACE, //#else DIALOG_BORDER_SPACE = 8, //#endif
Created attachment 68163 [details] picture for description of the bug
Created attachment 68164 [details] picture for description of the bug
I'm assuming that you are talking about C/C++ files...
Sorry, it is not C++ code (public static final int) May be mobility extension...
yep, it's J2ME. any additional info?
It is in mobility, seems like editor indentation engine goes crazy on preprocessor syntax. Mobility is not involved in formatting though.
> It is in mobility, seems like editor indentation engine goes crazy on preprocessor syntax No, it does not. You preprocessor syntax is basically a java line comment and it is formatted as such. divenvrsk, does it make any difference if you define each constant explicitly with 'public static final int'? Thanks
Reproducible. Problem seems to be in fieldgroup formating. If fields are defined separately it works fine.
Will resolve later.
NetBeans.org Migration: changing resolution from LATER to WONTFIX