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 577593 - Highlight trailing whitespace
Highlight trailing whitespace
Status: RESOLVED DUPLICATE of bug 551708
Product: gtksourceview
Classification: Platform
Component: General
0.2.0
Other All
: Normal enhancement
: ---
Assigned To: Johannes Schmid
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-01 09:22 UTC by scott
Modified: 2009-08-04 12:48 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Highlight trailing whitespace in C files (910 bytes, patch)
2009-07-30 13:23 UTC, Philip Withnall
reviewed Details | Review

Description scott 2009-04-01 09:22:41 UTC
Trailing whitespace is evil, it should be highlighted in some way so it can be eradicated
Comment 1 Johannes Schmid 2009-04-01 10:39:04 UTC
View->Editor->White spaces is your friend.
Comment 2 scott 2009-04-01 11:06:13 UTC
That shows all whitespaces, which is annoying.

I only want to see the trailing ones.
Comment 3 Johannes Schmid 2009-04-01 11:45:04 UTC
hmm, you might want to open a bug in gtksourceview then, maybe they can add such an option there.
Comment 4 Johannes Schmid 2009-04-01 11:45:51 UTC
hmm, you might want to open a bug in gtksourceview then, maybe they can add such an option there.

BTW, thanks for all your bug-reports!
Comment 5 scott 2009-04-01 12:26:07 UTC
Ok, moved this one over to gtksourceview
Comment 6 Johannes Schmid 2009-05-13 15:26:11 UTC
Shouldn't be assigned to me!
Comment 7 Philip Withnall 2009-07-30 13:23:15 UTC
Created attachment 139562 [details] [review]
Highlight trailing whitespace in C files

Here's a small patch to highlight whitespace errors in C source. It highlights the following:
 * trailing whitespace (spaces, tabs, etc.)
 * tabs with spaces on both sides, or just on the left
 * spaces with tabs on both sides

I think adding whitespace highlighting in specific language files is probably the best way to solve this problem, seeing as there are many languages where whitespace (even trailing whitespace) is important, if not desired; XML for example. In C, I don't think there are any circumstances where it's wanted.
Comment 8 Johannes Schmid 2009-07-30 13:38:16 UTC
That really looks simple and good - ok to commit? Perhaps also useful for some other languages (Java, Vala, etc.)
Comment 9 Philip Withnall 2009-07-30 19:26:56 UTC
(In reply to comment #8)
> That really looks simple and good - ok to commit? Perhaps also useful for some
> other languages (Java, Vala, etc.)

Maybe in that case I should add those contexts to def.lang instead, and just reference them in c.lang, vala.lang, etc.?
Comment 10 Paolo Borelli 2009-07-30 20:41:10 UTC
Thanks for the patch Philip.

gtksourceview already has support for drawing whitespaces and I'd prefer to extend that to draw trailing whitespace instead of defining them in the lang file
Comment 11 Philip Withnall 2009-07-31 14:45:35 UTC
(In reply to comment #10)
> gtksourceview already has support for drawing whitespaces and I'd prefer to
> extend that to draw trailing whitespace instead of defining them in the lang
> file

How would you cope with languages where whitespace is important?
Comment 12 Philip Withnall 2009-08-04 12:48:40 UTC
I suck at searching for duplicates.

*** This bug has been marked as a duplicate of 551708 ***