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

Bug 322750

Summary: Expanding the selection from within a macro expansion works unexpected
Product: [Tools] CDT Reporter: Anton Leherbauer <aleherb+eclipse>
Component: cdt-editorAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: kosashi
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
fix mschorn.eclipse: iplog-

Description Anton Leherbauer CLA 2010-08-16 03:36:17 EDT
E.g.

#define M(a,b) a=b
void f() {
	int a,b;
	M(a,b);
	a=b;
}
void g() {}

Put the cursor on the M(a,b) macro expansion.
Expanding the selection works OK until all of the macro expansion is selected, any further expansion (enclosing, next or previous element) will select the whole file.
Starting from a normal code location (e.g. a=b;) works OK.

Another observation: Expanding the selection beyond the whole file multiple times seems to add each attempt to the history although the selection did not actually change, i.e. to restore the previous selection I have to hit Alt+Shift+Down multiple times.
Comment 1 Markus Schorn CLA 2010-08-26 04:16:35 EDT
Hmm, the current node selector does not provide a method to find the enclosing node for the macro expansion. I need to add one.
Comment 2 Markus Schorn CLA 2010-08-26 07:19:48 EDT
Created attachment 177514 [details]
fix
Comment 3 Markus Schorn CLA 2010-08-26 07:20:57 EDT
Fixed in 8.0 > 20100826.