Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324838

Summary: Uncommenting with empty lines works unexpectedly
Product: [Tools] CDT Reporter: Markus Schorn <mschorn.eclipse>
Component: cdt-editorAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: yevshif
Version: 7.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 325438    
Bug Blocks:    
Attachments:
Description Flags
workaround until platform bug is fixed. mschorn.eclipse: iplog-

Description Markus Schorn CLA 2010-09-09 07:17:47 EDT
Use a file with 3 lines:
int a;

//

Select the first 2 lines such that the cursor is at the beginning of the 3rd line and press ctrl+/. The first line is commented.
//int a;

//

Now, without changing the selection (still 2 lines are selected, cursor at beginning of 3rd line) press ctrl+/, again. The first line is commented again, I'd expect it to be uncommented:
////int a;

//
Comment 1 Anton Leherbauer CLA 2010-09-13 04:32:54 EDT
I think this is basically the same issue I mentioned in bug 323456 comment 3.  This might require a fix in the platform.
Comment 2 Markus Schorn CLA 2010-09-16 07:36:12 EDT
Created attachment 179023 [details]
workaround until platform bug is fixed.
Comment 3 Markus Schorn CLA 2010-09-16 07:37:00 EDT
The workaround does not change the fact that the last line is not commented. However immediately uncommenting it works.
Comment 4 CDT Genie CLA 2010-09-16 19:23:08 EDT
*** cdt cvs genie on behalf of mschorn ***
Bug 324838: Workaround for platform issue in commenting code.

[*] ToggleCommentAction.java 1.15 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ToggleCommentAction.java?root=Tools_Project&r1=1.14&r2=1.15
Comment 5 Markus Schorn CLA 2010-11-04 04:51:03 EDT
Workaround has been removed by fix for bug 323456. The issue is resolved with Platform 3.7m3.