><br>
> I just tried the patch and it doesn't seem to work for me, if I change a<br>
> type name other occurrences of it don't change:<br>
><br>
> typedef int bar;<br>
><br>
> bar z;<br>
><br>
> if you change the name of the typedef, the typedef itself gets<br>
> re-highlighted when the cursor blinks (roughly a second later), but the<br>
> usage below don't.<br>
><br>
OK, right - the color would get updated only after you start typing.<br>
<br>
> However, instead of re-colorizing everything maybe we could only colorize<br>
> up to the end of the visible area, which would mitigate (or even<br>
> eradicate?) the slowness:<br>
><br>
> diff --git a/src/editor.c b/src/editor.c<br>
> index 1336588..cfbfbe9 100644--- a/src/editor.c+++ b/src/editor.c@@ -4682,12 +4682,20 @@ on_editor_scroll_event(GtkWidget *widget, GdkEventScroll *event, gpointer user_d<br>
>  static gboolean editor_check_colourise(GeanyEditor *editor)<br>
>  {<br>
>      GeanyDocument *doc = editor->document;+    gint start_line, end_line, start, end;<br>
><br>
>      if (!doc->priv->colourise_needed)<br>
>          return FALSE;<br>
> +    start_line = SSM(editor->sci, SCI_GETFIRSTVISIBLELINE, 0, 0);+    end_line = start_line + SSM(editor->sci, SCI_LINESONSCREEN, 0, 0);+    start_line = SSM(editor->sci, SCI_DOCLINEFROMVISIBLE, start_line, 0);+    end_line = SSM(editor->sci, SCI_DOCLINEFROMVISIBLE, end_line, 0);+    start = sci_get_position_from_line(editor->sci, start_line);+    end = sci_get_line_end_position(editor->sci, end_line);+<br>
>      doc->priv->colourise_needed = FALSE;-    sci_colourise(editor->sci, 0, -1);+    sci_colourise(editor->sci, start, end);<br>
><br>
>      /* now that the current document is colourised, fold points are now accurate,<br>
>       * so force an update of the current function/tag. */<br>
><br>
><br>
> This is insufficient because when the document gets loaded, we need to<br>
perform the whole-document colorization otherwise we won't get valid fold<br>
points ("fold all" doesn't work as expected with your patch).<br>
<br>
Anyway, we can have two types of colorization - full, performed on document<br>
load, and partial (the one from your patch), performed only to recolorize<br>
typenames (they won't modify fold points in any way so it should be safe).<br>
I've updated the patch with this and it seems to work well.<br>
<br>
(The updated patch still fixes the performance problem - the visible area<br>
colorization appears to be cheap.)<br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/pull/575#issuecomment-164157945">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ0mZBQtUGwuE3NKFRSUoBXvF8fz7ks5pPCQCgaJpZM4FYNzd.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/575#issuecomment-164157945"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>