Bug 424453 - Formatter removes CR from CR NL after line comments after #define directives
Summary: Formatter removes CR from CR NL after line comments after #define directives
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: Next   Edit
Hardware: PC Windows 8
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-19 10:01 EST by Armin Joachimsmeyer CLA
Modified: 2020-09-04 15:18 EDT (History)
4 users (show)

See Also:


Attachments
Second line is gone in editor (1.92 KB, image/png)
2013-12-19 10:01 EST, Armin Joachimsmeyer CLA
no flags Details
another image of a vanished line (2.59 KB, image/png)
2013-12-19 10:03 EST, Armin Joachimsmeyer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Armin Joachimsmeyer CLA 2013-12-19 10:01:03 EST
Created attachment 238487 [details]
Second line is gone in editor

After formatting the two lines 

#define DS1307_ADDR 0xD0 // 0x68 shifted left
bool rtcAvailable = false;

with "Ctrl Shift F", the CR NL after "left" is replaced by NL.

This leads to one line:

#define DS1307_ADDR 0xD0 // 0x68 shifted left NL bool rtcAvailable = false;

and in turn the bool variable will not be found and all references give errors.
Even the editor gets problems selecting the second line.

The project build still works, since the gnu compiler can deal with mixed CRNL and NL lines.

This is happening since the Kepler version.
Changing the codepage or changing the newline for new text files 
or changing the formattor from K&R to Gnu does not affect the error :-(

I am using Eclipse C/C++ Development Tools Version: 8.2.1.201309180223
Comment 1 Armin Joachimsmeyer CLA 2013-12-19 10:03:36 EST
Created attachment 238488 [details]
another image of a vanished line
Comment 2 Armin Joachimsmeyer CLA 2014-01-02 15:37:13 EST
Hi,
even replacing of all 4 classes in org.eclipse.cdt.core_5.5.0.201309180223.jar\org\eclipse\cdt\core\formatter withe the classes from my JUNO installation does not fix the bug.
Only complete switching back to JUNO helps with this bug.
Best Regards
Armin
Comment 3 krzysztof85 CLA 2014-01-20 13:11:12 EST
I have the same problem.