Revision: 2630 http://geany.svn.sourceforge.net/geany/?rev=2630&view=rev Author: ntrel Date: 2008-05-30 07:45:17 -0700 (Fri, 30 May 2008)
Log Message: ----------- Handle non-Scintilla GUI updates after SCN_PAINTED instead of SCN_UPDATEUI to hopefully appear more responsive to typing.
Modified Paths: -------------- trunk/ChangeLog trunk/src/editor.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-05-30 14:25:22 UTC (rev 2629) +++ trunk/ChangeLog 2008-05-30 14:45:17 UTC (rev 2630) @@ -4,6 +4,9 @@ Add deprecated macro for doc_array. * src/editor.c: Allow line breaking after typing any character, not just wordchars. + * src/editor.c: + Handle non-Scintilla GUI updates after SCN_PAINTED instead of + SCN_UPDATEUI to hopefully appear more responsive to typing.
2008-05-29 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2008-05-30 14:25:22 UTC (rev 2629) +++ trunk/src/editor.c 2008-05-30 14:45:17 UTC (rev 2630) @@ -170,19 +170,15 @@ }
+/* Note: Any GUI updates that don't affect scintilla should be done in on_painted(). */ static void on_update_ui(gint idx, G_GNUC_UNUSED SCNotification *nt) { ScintillaObject *sci = documents[idx]->sci; gint pos = sci_get_current_position(sci);
- /* undo / redo menu update */ - ui_update_popup_reundo_items(idx); - /* brace highlighting */ editor_highlight_braces(sci, pos);
- ui_update_statusbar(idx, pos); - /* Visible lines are only laid out accurately once [SCN_UPDATEUI] is sent, * so we need to only call sci_scroll_to_line here, because the document * may have line wrapping and folding enabled. @@ -209,6 +205,20 @@ }
+/* Any GUI updates that don't affect scintilla should be done here to + * appear more responsive to typing. */ +static void on_painted(gint idx, G_GNUC_UNUSED SCNotification *nt) +{ + ScintillaObject *sci = documents[idx]->sci; + gint pos = sci_get_current_position(sci); + + /* undo / redo menu update */ + ui_update_popup_reundo_items(idx); + + ui_update_statusbar(idx, pos); +} + + static void check_line_breaking(gint idx, gint pos, gchar c) { GeanyDocument *doc = documents[idx]; @@ -455,6 +465,10 @@ on_update_ui(idx, nt); break;
+ case SCN_PAINTED: + on_painted(idx, nt); + break; + case SCN_MODIFIED: { if (nt->modificationType & SC_STARTACTION && ! ignore_callback)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.