[gedit] Auto spell check on highlight-updated
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Auto spell check on highlight-updated
- Date: Sat, 17 Apr 2010 14:45:18 +0000 (UTC)
commit adf773fc4e18c61621cb236ec5677310351654bc
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sat Apr 17 16:29:38 2010 +0200
Auto spell check on highlight-updated
This solves the issue where the plugin is checking the buffer before
the syntax analysis has finished. This is only a temporary fix because
it means that the spell checker is rechecking multiple times in many
cases.
plugins/spell/gedit-automatic-spell-checker.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/plugins/spell/gedit-automatic-spell-checker.c b/plugins/spell/gedit-automatic-spell-checker.c
index f37133e..861fe22 100644
--- a/plugins/spell/gedit-automatic-spell-checker.c
+++ b/plugins/spell/gedit-automatic-spell-checker.c
@@ -690,6 +690,15 @@ tag_changed (GtkTextTagTable *table,
tag_table_changed (table, spell);
}
+static void
+highlight_updated (GtkSourceBuffer *buffer,
+ GtkTextIter *start,
+ GtkTextIter *end,
+ GeditAutomaticSpellChecker *spell)
+{
+ check_range (spell, *start, *end, FALSE);
+}
+
GeditAutomaticSpellChecker *
gedit_automatic_spell_checker_new (GeditDocument *doc,
GeditSpellChecker *checker)
@@ -741,6 +750,11 @@ gedit_automatic_spell_checker_new (GeditDocument *doc,
G_CALLBACK (mark_set),
spell);
+ g_signal_connect (doc,
+ "highlight-updated",
+ G_CALLBACK (highlight_updated),
+ spell);
+
g_signal_connect (spell->spell_checker,
"add_word_to_session",
G_CALLBACK (add_word_signal_cb),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]