Sorry, I forgot to include the patch.<br><br>Thanks,<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-24 12:47:50.110927000 -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 (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 (doc->changed != TRUE) {<br>+        document_set_text_changed(doc, TRUE);<br>+    }<br>+<br>     ui_update_popup_reundo_items(doc);<br> }<br> <br><div class="gmail_extra">
<br><br><div class="gmail_quote">2012/11/24 Evandro Borracini <span dir="ltr"><<a href="mailto:evandro.borracini@gmail.com" target="_blank">evandro.borracini@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br><br>Thanks everyone for the comments and suggestions. Based on them, I reverted back to the original code and just added an "if (doc->changed != TRUE)" before calling document_set_text_changed(doc, TRUE) in document_undo/redo_add(). <br>

<br>That prevents calling document_set_text_changed() again if doc->changed is already TRUE.<br>
<br>It worked fine and I don't see the latency anymore. :-)<br><br>Please find the complete patch below. Document_set_text_changed() function is not changed.<br><br>Please comment on that.<div class="im HOEnZb"><br><br>
Thanks again and regards,<br>
<br>Evandro<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2012/11/24 Nick Treleaven <span dir="ltr"><<a href="mailto:nick.treleaven@btinternet.com" target="_blank">nick.treleaven@btinternet.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 24/11/2012 14:04, Colomban Wendling wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A solution might be to only do the updates if (doc->changed != changed).<br>
  I didn't look at the interactions with the rest of Geany (nor test it<br>
actually), but looking at this I guess that changing it to:<br>
</blockquote>
<br></div>
I played with this a little. It won't work easily because document_set_text_changed is sometimes called to force a UI update, possibly even when the current doc hasn't changed. The API docs describe this behavior also.<div>

<div><br>
______________________________<u></u>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org" target="_blank">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-<u></u>bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>