GNOME Bugzilla – Bug 132826
Draw whitespace with symbols
Last modified: 2018-04-15 00:07:11 UTC
Most editors have an option to show whitespace. Usually, the whitespace charactors are rendered in gray. A tab is displayed as ----> (an arrow) and space as a raised dot.
I don't know if this is possible. These elements aren't part of the TextBuffer, so they need to drawn by gktsourceview itself?
Drawing them in GtkSourceView would be an insane hack :-) What we need is support for this in Pango, and that won't be easy.
*** Bug 117144 has been marked as a duplicate of this bug. ***
Doing this in GtkSourceView would indeed be insanely hard. It wouldn't actually be too hard to do it in GtkTextView ... finding out what characters in a paragraph are tab characters is pretty easy. (I assume that the goal here is to preserve the normal spacing for tab characters and just display an arrow overlayed over the top.) Related to bug 107560, since you presumably want zero-width characters to be displayed in visible-whitespace-mode.
Moving against gtk+/GtkTextView
hmmm... it is not clear to me why it would be "insanely hard" to do in GtkSourceView but not too hard in GtkTextView. BTW, I agree this should eventually be a GtkTextView feature, I am only curious.
Still badly missing this feature. If I knew a bit more about what was involved, I'd be willing to take a look at it. Can anyone give me (or anyone else browsing this ticket) some advice on what they would do, or where they would start if they were going to hack on this?
Take a look at the code for drawing the right margin in GtkSourceView (expose handler?). The same basic idea can be used for the whitespace markers.
Please take a look at moo_text_view_expose() in http://svn.berlios.de/viewcvs/ggap/moo/trunk/moo/mooedit/mootextview.c?view=markup . It's stupid and simple - just draws tabs and trailing spaces in expose handler. It's not a fix or something, of course; but it shows that in worst case one can 'just draw them'.
*** Bug 150837 has been marked as a duplicate of this bug. ***
Are there any new with this feature?
This is already possible in gtksourceview.
*** Bug 721014 has been marked as a duplicate of this bug. ***
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new