After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 749100 - Set GtkTextTag names for context classes
Set GtkTextTag names for context classes
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
git master
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-08 11:33 UTC by Sébastien Wilmet
Modified: 2015-05-09 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ContextEngine: set a GtkTextTag name for context classes (1.39 KB, patch)
2015-05-08 11:34 UTC, Sébastien Wilmet
none Details | Review
ContextEngine: set a GtkTextTag name for context classes (2.35 KB, patch)
2015-05-08 11:46 UTC, Sébastien Wilmet
none Details | Review

Description Sébastien Wilmet 2015-05-08 11:33:23 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.
Comment 1 Sébastien Wilmet 2015-05-08 11:34:14 UTC
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+).
Comment 2 Sébastien Wilmet 2015-05-08 11:46:06 UTC
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+).
Comment 3 Sébastien Wilmet 2015-05-08 11:46:34 UTC
(forgot the doc)
Comment 4 Sébastien Wilmet 2015-05-08 11:51:48 UTC
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.
Comment 5 Paolo Borelli 2015-05-09 12:59:25 UTC
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
Comment 6 Sébastien Wilmet 2015-05-09 14:13:20 UTC
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.