GNOME Bugzilla – Bug 749100
Set GtkTextTag names for context classes
Last modified: 2015-05-09 14:13:20 UTC
The use case is for GtkSpell to use the no-spell-check context class without a hard-dependency on GtkSourceView (GtkSpell only depends on GTK+). See the attached patch.
Created attachment 303069 [details] [review] ContextEngine: set a GtkTextTag name for context classes The use case is for GtkSpell to use the no-spell-check context class without a hard-dependency on GtkSourceView (GtkSpell only depends on GTK+).
Created attachment 303070 [details] [review] ContextEngine: set a GtkTextTag name for context classes The use case is for GtkSpell to use the no-spell-check context class without a hard-dependency on GtkSourceView (GtkSpell only depends on GTK+).
(forgot the doc)
The patch for GtkSpell is already written, the maintainer wanted this feature so I guess the patch will be accepted, once the GtkSourceView part is done. Another way to solve the problem, but which is much less convenient, is to add a no-spell-check boolean property to GtkTextTag. But GtkSpell would need to traverse all tags of the tag table to see those that have the no-spell-check property as true, and then use that list of tags to skip the no-spell-check region. The problem is much easier when there is only one possible tag.
I do not recall if there is any additional cost in naming the tags (apart from the negligible memory usage). If that's not the case, I am ok with this. I know it is just bikeshedding, but I would prefer lower case and ":" separator since that's what we use for language styles (c:keywords etc), so the name would be gtksourceview:context-classes:no-spell-check
No there should be no visible difference, the tag is just inserted in a hash table in the tag table. I've modified the commit with the new name, and pushed it: https://git.gnome.org/browse/gtksourceview/commit/?id=a3e289b2cde7f6cfb62cc9c24f64d8d2a8df39ad Thanks for the review.