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 737796 - Drawing whitespaces only in selected text
Drawing whitespaces only in selected text
Status: RESOLVED OBSOLETE
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-02 18:22 UTC by Robert Roth
Modified: 2021-07-05 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Robert Roth 2014-10-02 18:22:01 UTC
Some text editors provide support for showing the whitespaces on a part of the file, e.g. on the selected text. Currently GtkSourceView can only be set the draw-spaces property globally.
Comment 1 Sébastien Wilmet 2014-10-02 20:50:15 UTC
Yes, it can be useful. See also bug #683678 and bug #721015.
Comment 2 Robert Roth 2014-10-03 06:17:06 UTC
Thanks for the comment Sébastien. Bug #683678  looks relevant indeed, with your proposed solution there to have separate GtkSourceSpaceType and GtkSourceSpaceLocation enums, we could simply add a SELECTION value to the GtkSourceSpaceLocation enum, as it clearly fits in that context. 
Would that be OK for you? If yes, I might take over and extend lamefun's patches from #683678.
Comment 3 Sébastien Wilmet 2014-10-03 10:45:56 UTC
Note that ideally the space drawing should be done by Pango and GtkTextView to have better performances. But it's not going to happen soon since nobody is working on that, having a better API in GtkSourceView in the meantime would be nice I think, and if there are problems with the new API, we can make another iteration when moving the API in GtkTextView.

Adding a SELECTION flag seems a good solution. Providing two GtkTextIters would be more flexible, but can be done independently.
Comment 4 Robert Roth 2014-10-11 21:25:27 UTC
Bug 683678 reguested a use-case: sublime text has three possible settings for drawing whitespaces (all, none, selected) and gtksourceview already supports two.
Showing whitespaces in selection only is the last option missing.
Comment 5 Sébastien Wilmet 2014-10-12 08:58:01 UTC
Ok, but why is it useful to draw spaces only for the selected text? Why sublime text do it?

The reason that I see is to be able to know exactly what is copied or deleted.
Comment 6 Sébastien Wilmet 2016-09-30 19:52:31 UTC
(In reply to Sébastien Wilmet from comment #3)
> Adding a SELECTION flag seems a good solution.

Bug 683678 is fixed, there is now a GtkSourceSpaceLocationFlags enum.

> Providing two GtkTextIters
> would be more flexible, but can be done independently.

And there is now GtkSourceTag, which is the most flexible.
Comment 7 GNOME Infrastructure Team 2021-07-05 11:00:32 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/

Thank you for your understanding and your help.