Hi,<br><br>I started using Geany a couple of weeks ago and I noticed a slower response to typed text than my previous editor Scite. Running both editors at the same time, it was noticeable to me that Geany had a slightly longer latency time for printing the characters on the screen (and/or for moving the cursor to the next line after hitting the Enter key).<br>

<br>Well, I think that might not be noticeable to most of users (since they run Geany on fast machines) but It is annoying me because I'm working on a shared server (which most of time is very loaded), making the latency even bigger. So, I've been trying to identify the cause of the latency.<br>
<br>After some experiments and I think I could find the cause and an workaround. I just need some help from you guys for getting a final solution.<br>
<br>I see that the latency is caused the following sequence of function calls:<br><br>editor.c: on_editor_notify()  inside "switch (nt->nmhdr.code) ... case SCN_MODIFIED" :<br>        document_undo_add(doc, UNDO_SCINTILLA, NULL);  (file: document.c)<br>
            document_set_text_changed(doc, TRUE); (file: document.c)<br>                ui_update_tab_status(doc) (file: ui_utils.c)<br>                   sidebar_openfiles_update(doc); (file: ui_utils.c)<br><br><br>It seems that the latency is because sidebar_openfiles_update() is called too frequently (apparently at each typed key). I've made an experiment by commenting  out the call to ui_update_tab_status(doc) (insided  document_set_text_changed() ) and I got Geany as sharp as Scite!!!    :-)<br>

<br>I'd like to propose the fix below (please find the patch in the end of this message). It worked fine for me but since I'm not much familiar with Geany source code, I need you guys to review it.<br><br>Could you guys please review my fix? Does any of you see any better solution?<br>
<br>Please notice that I'm changing two functions:<br>document_undo_add() - reduced the latency while typing text<br>document_redo_add() - reduced the latency for the undo operation (CTRL+Z)<br><br>Thanks in advance and regards,<br>
<br>
Evandro<br><br><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-23 20:28:17.535008000 -0800<br>
@@ -2676,7 +2676,9 @@ 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>+    /* document_set_text_changed(doc, TRUE); */<br>
+    doc->changed = TRUE;<br>+<br>     ui_update_popup_reundo_items(doc);<br> }<br> <br>@@ -2840,7 +2842,9 @@ 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>+    /* document_set_text_changed(doc, TRUE); */<br>+    doc->changed = TRUE;<br>+<br>     ui_update_popup_reundo_items(doc);<br> }<br> <br><br>