[Lazarus] Beta testers on trunk: Inactive IFDEF code greyed out

Martin lazarus at mfriebe.de
Sun May 26 16:26:23 CEST 2013

In SVN trunk it is now possible to have inactive IFDEF code greyed out, 
or otherwise marked.

The feature is still being tested, but seems to generally work well by now.

If you wish to help testing, compile the IDE with the following define:
(command-line option -dWithSynMarkupIfDef )

Colors can be set in the editor options. There will be new entries at 
the bottom of the tree containing all the colors.

There are 3 types of block (examples for ifdef, but same for $else and 

1) {$IFDEF SomethingDefined}  active code
2) {$IFDEF Something_NOT_Defined}  inactive code
3) {$IFDEF SomethingInInclude}  active code
    where the IFDEF is in an include, that is used in several places, 
and SomethingInInclude is defined in one place, but undefined in the other.
   So the code will be compiled in the exe.
   But it is not active, in all places from which the include file was used

A) "code" is the code between the $IFDEF/$ELES/$ENDIF
b) "node" are the directives them self.

Setting colors:
The current pre-set expects colors to be set with alpha channel.
If solid colors are used, the colors for the IFDEF markup will replace 
all other markup.

That is, if you apply a solid red background for inactive code, then 
this will even hide the blue background of a selection. To correct that 
use the new priority editor and lower the priority of the "inactive code 

If you fade (alpha) the background to red, then you will see the block 
selection also faded. (That is with the default priority)
In this case it will also fade any other background color used (like 
current line, or all occurrences of word at caret)

More information about the Lazarus mailing list