Revision: 5735 http://geany.svn.sourceforge.net/geany/?rev=5735&view=rev Author: colombanw Date: 2011-04-24 15:30:20 +0000 (Sun, 24 Apr 2011)
Log Message: ----------- Don't update the tag list when the user is typing
Reset the pending update delay when we get a Scintilla change not to reparse the tags when the user is actively typing.
This should not be a problem since the user is unlikely to care about the tags being updated if he's actively typing, and should avoid annoying delays when actively typing inside very large files.
Patch by Yura Siamashka, thanks.
Modified Paths: -------------- trunk/src/editor.c
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2011-04-23 12:18:32 UTC (rev 5734) +++ trunk/src/editor.c 2011-04-24 15:30:20 UTC (rev 5735) @@ -86,7 +86,7 @@ static gchar current_word[GEANY_MAX_WORD_LENGTH];
/* whether there is a tag list update pending */ -static gboolean document_tags_update_pending = FALSE; +static guint document_tags_update_source = 0;
/* Initialised in keyfile.c. */ GeanyEditorPrefs editor_prefs; @@ -1008,19 +1008,17 @@ if (!main_status.quitting && DOC_VALID(doc)) document_update_tag_list(doc, TRUE);
- document_tags_update_pending = FALSE; + document_tags_update_source = 0; return FALSE; }
static void request_tag_list_update(GeanyDocument *doc) { - if (!document_tags_update_pending) - { - document_tags_update_pending = TRUE; - g_timeout_add_full(G_PRIORITY_LOW, editor_prefs.autocompletion_update_freq, - on_document_update_tags_idle, doc, NULL); - } + if (document_tags_update_source) + g_source_remove(document_tags_update_source); + document_tags_update_source = g_timeout_add_full(G_PRIORITY_LOW, + editor_prefs.autocompletion_update_freq, on_document_update_tags_idle, doc, NULL); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.