Branch: refs/heads/master Author: Evandro Borracini evandro.borracini@gmail.com Committer: Nick Treleaven nick.treleaven@btinternet.com Date: Tue, 27 Nov 2012 17:05:51 UTC Commit: 3205eeaa714222114fd82063fe51f9656d3e635d https://github.com/geany/geany/commit/3205eeaa714222114fd82063fe51f9656d3e63...
Log Message: ----------- Reduce unnecessary redraws when typing
Modified Paths: -------------- src/document.c
Modified: src/document.c 10 files changed, 8 insertions(+), 2 deletions(-) =================================================================== @@ -2506,6 +2506,7 @@ void document_undo_clear(GeanyDocument *doc) }
+/* note: this is called on SCN_MODIFIED notifications */ void document_undo_add(GeanyDocument *doc, guint type, gpointer data) { undo_action *action; @@ -2518,7 +2519,10 @@ void document_undo_add(GeanyDocument *doc, guint type, gpointer data)
g_trash_stack_push(&doc->priv->undo_actions, action);
- document_set_text_changed(doc, TRUE); + /* avoid unnecessary redraws */ + if (type != UNDO_SCINTILLA || !doc->changed) + document_set_text_changed(doc, TRUE); + ui_update_popup_reundo_items(doc); }
@@ -2682,7 +2686,9 @@ static void document_redo_add(GeanyDocument *doc, guint type, gpointer data)
g_trash_stack_push(&doc->priv->redo_actions, action);
- document_set_text_changed(doc, TRUE); + if (type != UNDO_SCINTILLA || !doc->changed) + document_set_text_changed(doc, TRUE); + ui_update_popup_reundo_items(doc); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).