diff --git a/components/codetools/linkscanner.pas b/components/codetools/linkscanner.pas index 511952c8e1..9ad1c3de07 100644 --- a/components/codetools/linkscanner.pas +++ b/components/codetools/linkscanner.pas @@ -267,9 +267,9 @@ const type TLSDirectiveState = ( - lsdsActive, - lsdsInactive,// e.g. an IfDef which code was skipped - lsdsSkipped // has inactive parent + lsdsActive, // was executed + lsdsInactive,// was executed, but expression result was false and following code was skipped + lsdsSkipped // was not executed ); TLSDirectiveStates = set of TLSDirectiveState; diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 8882b1785b..f6a5c458ef 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -5509,11 +5509,11 @@ begin until (ADirective^.SrcPos<>SrcPos) or (TCodeBuffer(ADirective^.Code)<>Code) or (i > Scanner.DirectiveCount); dec(i); - if (ActiveCnt=1) and (InactiveCnt=0) and (SkippedCnt=0) then + if (ActiveCnt>0) and (InactiveCnt=0) and (SkippedCnt=0) then SynState:=idnEnabled - else if (InactiveCnt=1) and (ActiveCnt=0) and (SkippedCnt=0) then + else if (ActiveCnt=0) and (InactiveCnt+SkippedCnt>0) then SynState:=idnDisabled - else if (InactiveCnt>0) or (ActiveCnt>0) then + else if (ActiveCnt>0) then SynState:=idnTempEnabled else SynState:=idnInvalid;