SF.net SVN: geany-plugins:[172] trunk/spellcheck

eht16 at users.sourceforge.net eht16 at xxxxx
Mon Sep 8 18:48:50 UTC 2008


Revision: 172
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=172&view=rev
Author:   eht16
Date:     2008-09-08 18:48:49 +0000 (Mon, 08 Sep 2008)

Log Message:
-----------
Do not check numbers and words starting with digits.
Use the 'gtk-spell-check' GTK stock icon for the main menu item in the Tools menu.

Modified Paths:
--------------
    trunk/spellcheck/ChangeLog
    trunk/spellcheck/src/spellcheck.c

Modified: trunk/spellcheck/ChangeLog
===================================================================
--- trunk/spellcheck/ChangeLog	2008-09-08 14:37:12 UTC (rev 171)
+++ trunk/spellcheck/ChangeLog	2008-09-08 18:48:49 UTC (rev 172)
@@ -3,6 +3,9 @@
  * src/spellcheck.c:
    Add toolbar button to quickly enable/disable the
    'check while typing' setting (closes #2062239).
+   Do not check numbers and words starting with digits.
+   Use the 'gtk-spell-check' GTK stock icon for the main menu
+   item in the Tools menu.
 
 
 2008-08-03  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/spellcheck/src/spellcheck.c
===================================================================
--- trunk/spellcheck/src/spellcheck.c	2008-09-08 14:37:12 UTC (rev 171)
+++ trunk/spellcheck/src/spellcheck.c	2008-09-08 18:48:49 UTC (rev 172)
@@ -345,6 +345,10 @@
 	gchar **suggs;
 	GString *str = g_string_sized_new(256);
 
+	/* ignore numbers or words starting with digits */
+	if (isdigit(*word))
+		return 0;
+
 	/* early out if the word is spelled correctly */
 	if (enchant_dict_check(sc->dict, word, -1) == 0)
 		return 0;
@@ -618,7 +622,9 @@
 {
 	const gchar *lang = g_getenv("LANG");
 	/** TODO check whether the returned lang is actually provided by enchant and
-	 *  choose something else if not */
+	 *  choose something else if not
+	 *  N.B. this is not really possible/reasonable with enchant < 1.4.3 because of a
+	 *  bug in the Zemberek provider which always reports it has the requested dict */
 	if (NZV(lang))
 	{
 		if (g_ascii_strncasecmp(lang, "C", 1) == 0)
@@ -789,7 +795,8 @@
 
 	locale_init();
 
-	plugin_fields->menu_item = sp_item = gtk_menu_item_new_with_mnemonic(_("_Spell Check"));
+	plugin_fields->menu_item = sp_item =
+		gtk_image_menu_item_new_from_stock("gtk-spell-check", NULL);
 	plugin_fields->flags = PLUGIN_IS_DOCUMENT_SENSITIVE;
 
 	toolbar_update();


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