<p>Irrespective of the uses in plugins, Geany core uses <code>highlighting_is_code_style()</code> for:</p>
<ul>
<li>matching parentheses, definitely don't want to do that in regexes</li>
<li>brace indenting, don't want to see braces in regexes</li>
<li>get line end position, hmm this might want to see regexes as code, not sure</li>
<li>parens in calltip handling, don't want to match in regexes</li>
<li>enabling autocomplete (so it doesn't happen in strings and comments) and that should exclude regexes as well</li>
</ul>
<p>That seems to suggest that in core most places regexes should not be counted as code.  My simple solution was to put them in <code>highlighting_is_string_style()</code> since it already has the basic infrastructure, but I understand that upsets spell checking and maybe other uses of <code>highlighting_is_string_style()</code> so I guess that says we need to add them to <code>highlighting_is_code_style()</code> or have a <code>highlighting_is_regex_style()</code> that it can use.</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/pull/1502#issuecomment-304508272">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ8HSmVwpfOvqT-01J0BbCP03AwQRks5r-VvPgaJpZM4Nmayz">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJwMmgRkGj5OyffQSaQnX7Qd12Vpiks5r-VvPgaJpZM4Nmayz.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/pull/1502#issuecomment-304508272"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@elextr in #1502: Irrespective of the uses in plugins, Geany core uses `highlighting_is_code_style()` for:\r\n\r\n* matching parentheses, definitely don't want to do that in regexes\r\n* brace indenting, don't want to see braces in regexes\r\n* get line end position, hmm this might want to see regexes as code, not sure\r\n* parens in calltip handling, don't want to match in regexes\r\n* enabling autocomplete (so it doesn't happen in strings and comments) and that should exclude regexes as well\r\n\r\nThat seems to suggest that in core most places regexes should not be counted as code.  My simple solution was to put them in `highlighting_is_string_style()` since it already has the basic infrastructure, but I understand that upsets spell checking and maybe other uses of `highlighting_is_string_style()` so I guess that says we need to add them to `highlighting_is_code_style()` or have a `highlighting_is_regex_style()` that it can use.\r\n"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1502#issuecomment-304508272"}}}</script>