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 589366 - Show whitespace differences in inline highlighting
Show whitespace differences in inline highlighting
Status: RESOLVED OBSOLETE
Product: meld
Classification: Other
Component: filediff
git master
Other All
: Normal enhancement
: ---
Assigned To: meld-maint
Stephen Kennedy
Depends on:
Blocks:
 
 
Reported: 2009-07-22 12:32 UTC by Oliver Gerlich
Modified: 2017-12-13 18:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
highlite trailing whitespace at EOL (2.01 KB, patch)
2009-07-22 21:51 UTC, Vincent Legoll
none Details | Review
fix occurrences of trailing ws inside meld code (12.95 KB, patch)
2009-07-22 22:10 UTC, Vincent Legoll
none Details | Review

Description Oliver Gerlich 2009-07-22 12:32:30 UTC
It would be nice if the file diff view could (optionally) highlight trailing whitespace, so that users notice if they made a change that would introduce this. Some kind of "squiggly underline" or bold red text could be used for highlighting.

Personally, I use Meld for reviewing changes before committing, so it is the last stage where such mistakes could be caught. Some editors already show trailing whitespaces, but some don't; so I always check for trailing whitespace "manually" in the diff view, and it would be neat if Meld would help there.
Comment 1 Vincent Legoll 2009-07-22 21:51:47 UTC
Created attachment 139032 [details] [review]
highlite trailing whitespace at EOL

This is absolutely brute-force-y, if someone has a better idea or patch...
Comment 2 Vincent Legoll 2009-07-22 21:54:09 UTC
TO MAYBE DO:
preferences to control the behavior (and maybe avoid the costs)
* enable / disable
* only inside diffs / everywhere
Comment 3 Kai Willadsen 2009-07-22 22:06:02 UTC
Presumably we don't want to just highlight EOL whitespace, but rather *changes* in whitespace at EOL. This would involve messing with the inline diff mechanics.
Comment 4 Vincent Legoll 2009-07-22 22:10:50 UTC
Created attachment 139033 [details] [review]
fix occurrences of trailing ws inside meld code

If we want to fix the bug, we should fix meld source code not to show red line endings everywhere...

There's a few totally legitimates fixes in this could-have-been-made-with-sed patch, but also a bunch in comments or docstrings, do we want them all or should I filter a bit ?
Comment 5 Kai Willadsen 2009-07-22 22:25:05 UTC
Applying such patches just pollutes the git history with meaningless changes. A better approach is to fix trailing whitespace whenever you modify the offending bit of code. e.g., before you push, make sure you pipe your patches through 'git diff | git apply --whitespace=fix -'

Alternatively, you can turn on a git pre-commit hook so that it won't *let* you commit EOL whitespace changes. I believe that the sample pre-commit hook shipped with git does exactly this.
Comment 6 Kai Willadsen 2015-10-18 21:08:26 UTC
In bug 744179, GtkSourceView has added the ability to toggle draw whitespace based on tagged text. The easiest and best way to fix this bug (and other requests) would be to toggle the draw-whitespace property in our GtkTextTag that we already use for doing inline highlighting. This should be trivial once we require GtkSourceView 3.20 (or we can add it conditionally with a feature detect).

The only extra thing we might want to do would be to also apply a new tag to insert chunks to highlight whitespace that's been *added*. I'm not sure whether that makes as much sense though.
Comment 7 Kai Willadsen 2017-11-19 01:10:58 UTC
I've just pushed a change to master that does the above. I'm not certain whether this will stay in, because the contrast issues between the coloured background and the low-contrast foreground used for the whitespace are... pretty bad. If we can figure out a sane way to make the whitespace drawing be more obvious then I imagine this will stay.
Comment 8 GNOME Infrastructure Team 2017-12-13 18:51:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/meld/issues/18.