SF.net SVN: geany-plugins:[293] trunk/spellcheck
eht16 at users.sourceforge.net
eht16 at xxxxx
Wed Nov 12 19:49:49 UTC 2008
Revision: 293
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=293&view=rev
Author: eht16
Date: 2008-11-12 19:49:49 +0000 (Wed, 12 Nov 2008)
Log Message:
-----------
When using 'Ignore All', add the word to ignore to the enchant session list to really ignore it for further checks, too.
Modified Paths:
--------------
trunk/spellcheck/ChangeLog
trunk/spellcheck/src/gui.c
trunk/spellcheck/src/speller.c
trunk/spellcheck/src/speller.h
Modified: trunk/spellcheck/ChangeLog
===================================================================
--- trunk/spellcheck/ChangeLog 2008-11-11 21:13:35 UTC (rev 292)
+++ trunk/spellcheck/ChangeLog 2008-11-12 19:49:49 UTC (rev 293)
@@ -1,3 +1,10 @@
+2008-11-12 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/speller.c, src/speller.h, src/gui.c:
+ When using 'Ignore All', add the word to ignore to the enchant
+ session list to really ignore it for further checks, too.
+
+
2008-11-10 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/speller.c, src/speller.h, src/gui.c:
Modified: trunk/spellcheck/src/gui.c
===================================================================
--- trunk/spellcheck/src/gui.c 2008-11-11 21:13:35 UTC (rev 292)
+++ trunk/spellcheck/src/gui.c 2008-11-12 19:49:49 UTC (rev 293)
@@ -157,6 +157,8 @@
p_sci->set_selection_end(clickinfo.doc->editor->sci, endword);
p_sci->replace_sel(clickinfo.doc->editor->sci, sugg);
+ /** TODO replace word */
+
p_sci->indicator_clear(clickinfo.doc->editor->sci, startword, endword - startword);
}
}
@@ -172,12 +174,15 @@
if (clickinfo.doc == NULL || clickinfo.word == NULL || clickinfo.pos == -1)
return;
- /* we either ignore the word, so we only remove all indicators or
- * we add the word to the personal dictionary */
- if (! ignore)
+ /* if we ignore the word, we add it to the current session, to ignore it
+ * also for further checks*/
+ if (ignore)
+ speller_add_word_to_session(clickinfo.word);
+ /* if we do not ignore the word, we add the word to the personal dictionary */
+ else
speller_add_word(clickinfo.word);
- /* Remove all indicators on the added word */
+ /* Remove all indicators on the added/ignored word */
sci = clickinfo.doc->editor->sci;
str = g_string_sized_new(256);
doc_len = p_sci->get_length(sci);
Modified: trunk/spellcheck/src/speller.c
===================================================================
--- trunk/spellcheck/src/speller.c 2008-11-11 21:13:35 UTC (rev 292)
+++ trunk/spellcheck/src/speller.c 2008-11-12 19:49:49 UTC (rev 293)
@@ -350,7 +350,6 @@
void speller_add_word(const gchar *word)
{
enchant_dict_add_to_pwl(speller_dict, clickinfo.word, -1);
-
}
gboolean speller_dict_check(const gchar *word)
@@ -369,6 +368,14 @@
}
+void speller_add_word_to_session(const gchar *word)
+{
+ g_return_if_fail(speller_dict != NULL);
+
+ enchant_dict_add_to_session(speller_dict, word, -1);
+}
+
+
void speller_init(void)
{
speller_broker = enchant_broker_init();
Modified: trunk/spellcheck/src/speller.h
===================================================================
--- trunk/spellcheck/src/speller.h 2008-11-11 21:13:35 UTC (rev 292)
+++ trunk/spellcheck/src/speller.h 2008-11-12 19:49:49 UTC (rev 293)
@@ -45,6 +45,8 @@
gboolean speller_is_text(GeanyDocument *doc, gint pos);
+void speller_add_word_to_session(const gchar *word);
+
void speller_init(void);
void speller_free(void);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Plugins-Commits
mailing list