mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Bug 397496. A missing piece of the previous fix.
This commit is contained in:
parent
e679870821
commit
3602ab4d96
1 changed files with 16 additions and 14 deletions
|
@ -3885,20 +3885,22 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
|
|||
if (currentOffset > nodeEndOffset) {
|
||||
return;
|
||||
}
|
||||
IASTNodeLocation[] locations= node.getNodeLocations();
|
||||
for (int i= 0; i < locations.length; i++) {
|
||||
IASTNodeLocation nodeLocation= locations[i];
|
||||
if (nodeLocation instanceof IASTMacroExpansionLocation) {
|
||||
IASTFileLocation expansionLocation= nodeLocation.asFileLocation();
|
||||
int startOffset= expansionLocation.getNodeOffset();
|
||||
int endOffset= startOffset + expansionLocation.getNodeLength();
|
||||
if (currentOffset <= startOffset) {
|
||||
break;
|
||||
}
|
||||
if (currentOffset < endOffset ||
|
||||
currentOffset == endOffset && i == locations.length - 1) {
|
||||
scribe.skipRange(startOffset, endOffset);
|
||||
break;
|
||||
if (!fInsideMacroArguments) {
|
||||
IASTNodeLocation[] locations= node.getNodeLocations();
|
||||
for (int i= 0; i < locations.length; i++) {
|
||||
IASTNodeLocation nodeLocation= locations[i];
|
||||
if (nodeLocation instanceof IASTMacroExpansionLocation) {
|
||||
IASTFileLocation expansionLocation= nodeLocation.asFileLocation();
|
||||
int startOffset= expansionLocation.getNodeOffset();
|
||||
int endOffset= startOffset + expansionLocation.getNodeLength();
|
||||
if (currentOffset <= startOffset) {
|
||||
break;
|
||||
}
|
||||
if (currentOffset < endOffset ||
|
||||
currentOffset == endOffset && i == locations.length - 1) {
|
||||
scribe.skipRange(startOffset, endOffset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue