mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fix for 154350
This commit is contained in:
parent
13fff05bbc
commit
1d508cd878
1 changed files with 10 additions and 6 deletions
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.ui.editor;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.EmptyStackException;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
@ -504,13 +505,16 @@ public class CSourceViewerDecorationSupport
|
||||||
}
|
}
|
||||||
} else if (statement instanceof IASTPreprocessorEndifStatement) {
|
} else if (statement instanceof IASTPreprocessorEndifStatement) {
|
||||||
IASTPreprocessorEndifStatement endifStmt = (IASTPreprocessorEndifStatement)statement;
|
IASTPreprocessorEndifStatement endifStmt = (IASTPreprocessorEndifStatement)statement;
|
||||||
boolean wasInInactiveCode = ((Boolean)inactiveCodeStack.pop()).booleanValue();
|
try {
|
||||||
if (inInactiveCode && !wasInInactiveCode) {
|
boolean wasInInactiveCode = ((Boolean)inactiveCodeStack.pop()).booleanValue();
|
||||||
IASTNodeLocation nodeLocation = endifStmt.getNodeLocations()[0];
|
if (inInactiveCode && !wasInInactiveCode) {
|
||||||
int inactiveCodeEnd = nodeLocation.getNodeOffset() + nodeLocation.getNodeLength();
|
IASTNodeLocation nodeLocation = endifStmt.getNodeLocations()[0];
|
||||||
positions.add(new ReusableRegion(inactiveCodeStart, inactiveCodeEnd - inactiveCodeStart));
|
int inactiveCodeEnd = nodeLocation.getNodeOffset() + nodeLocation.getNodeLength();
|
||||||
|
positions.add(new ReusableRegion(inactiveCodeStart, inactiveCodeEnd - inactiveCodeStart));
|
||||||
|
}
|
||||||
|
inInactiveCode = wasInInactiveCode;
|
||||||
}
|
}
|
||||||
inInactiveCode = wasInInactiveCode;
|
catch( EmptyStackException e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inInactiveCode) {
|
if (inInactiveCode) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue