Thanks Dimitar,<br><br>I've updated the patch to always call document_set_text_changed() for BOM/ENCODING.  For UNDO_SCINTILLA, document_set_text_changed() is called only at the first document change. <br><br>I've tested and it worked fine for me. The latency while typing is gone.<br>
As expected, we still have a small latency at the first key hit but that doesn't create any trouble at all.<br><br>The new patch is below.<br><br>Best Regards,<br><br>Evandro<br><br>diff -Naurp geany-0.20/src/document.c geany-0.20_fast/src/document.c<br>
--- geany-0.20/src/document.c    2012-11-23 20:22:22.564735000 -0800<br>+++ geany-0.20_fast/src/document.c    2012-11-25 07:16:47.602542000 -0800<br>@@ -2676,7 +2676,10 @@ void document_undo_add(GeanyDocument *do<br> <br>
     g_trash_stack_push(&doc->priv->undo_actions, action);<br> <br>-    document_set_text_changed(doc, TRUE);<br>+    if ((type != UNDO_SCINTILLA) || (doc->changed != TRUE)) {<br>+        document_set_text_changed(doc, TRUE);<br>
+    }<br>+<br>     ui_update_popup_reundo_items(doc);<br> }<br> <br>@@ -2840,7 +2843,10 @@ static void document_redo_add(GeanyDocum<br> <br>     g_trash_stack_push(&doc->priv->redo_actions, action);<br> <br>-    document_set_text_changed(doc, TRUE);<br>
+    if ((type != UNDO_SCINTILLA) || (doc->changed != TRUE)) {<br>+        document_set_text_changed(doc, TRUE);<br>+    }<br>+<br>     ui_update_popup_reundo_items(doc);<br> }<br> <br><br><br><br><br><br><div class="gmail_extra">
<br><br><div class="gmail_quote">2012/11/25 Dimitar Zhekov <span dir="ltr"><<a href="mailto:dimitar.zhekov@gmail.com" target="_blank">dimitar.zhekov@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sat, 24 Nov 2012 14:09:12 +0000<br>
Nick Treleaven <<a href="mailto:nick.treleaven@btinternet.com">nick.treleaven@btinternet.com</a>> wrote:<br>
<br>
> I played with this a little. It won't work easily because<br>
> document_set_text_changed is sometimes called to force a UI update,<br>
</div>> possibly even when the current doc hasn't changed. [...]<br>
<div class="im"><br>
On Sat, 24 Nov 2012 15:11:48 -0600<br>
Evandro Borracini <<a href="mailto:evandro.borracini@gmail.com">evandro.borracini@gmail.com</a>> wrote:<br>
<br>
> Thanks everyone for the comments and suggestions. Based on them, I<br>
> reverted back to the original code and just added an "if<br>
> (doc->changed != TRUE)" before calling document_set_text_changed<br>
> (doc, TRUE) in document_undo/redo_add().<br>
<br>
</div>document_redo_add(doc, UNDO_SCINTILLA, NULL); <-- text changed<br>
document_redo_add(doc, UNDO_BOM, GINT_TO_POINTER(doc->has_bom));<br>
document_redo_add(doc, UNDO_ENCODING, g_strdup(doc->encoding));<br>
<br>
The 2nd and 3rd call probably rely on redo_add to call<br>
document_set_text_changed(), to update the status bar. You can check<br>
that (my Geany version is a bit outdated), and update the patch to<br>
call set_text for BOM/ENCODING (they are rare). Same for undo.<br>
<br>
Aside from that, the patch looks reasonable. For plugins, we allow<br>
document_set_text_changed(), but not undo/redo_add(), which is OK.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
E-gards: Jimmy<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div>