<p>As <a href="https://github.com/codebrainz" class="user-mention">@codebrainz</a> pointed out, Scintilla uses preprocessor directives to decide whether a code block is enabled or not.  This is easy for <code>#if 0</code>s, but a lot trickier for less obvious directives, like <code>#if ONE</code>, where Scintilla has to know the value of <code>ONE</code> to decide -- and it assumes any unknown evaluate to false, so would disable the <code>#if ONE</code> case.</p>

<p>To get better results, yes, CTags could be used.  Scintilla's C lexer has a set of keywords used for predefined preprocessor definitions (set n°4, "Preprocessor definitions"), that can be filled with <code>definition[=value]</code> entries.  A plugin could update those keywords from the tagmanager's workspace tags to help Scintilla make the right choice.</p>

<p>An alternative could be proposing an alternative, dumber, preprocessor parser for the Scintilla lexer, that would only look out for literal values for disabling parts, with <code>#if 0</code> or <code>#if 1</code>.  That would have to be submitted to Scintilla.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1047#issuecomment-222461094">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/ABDrJ94Wj-rndnEayqrN2FZ-cb3jHlGxks5qGrkGgaJpZM4IpR6k">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJy_b0ZN-0mKhciDepM2NJd6O-MwUks5qGrkGgaJpZM4IpR6k.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1047#issuecomment-222461094"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>