Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

When a suggested edit changes the indentation of some code (for example indenting four spaces to get proper formatting), the markdown diff often shows the changed spaces highlighted differently in each line:

diff view

This makes it unnecessarily unclear what really was edited.

Instead, all the lines should just have the first four spaces highlighted.

share|improve this question
up vote 11 down vote accepted

Instead, all the lines should just have the first four spaces highlighted.

From the next build on, this will be the case.

When creating those diffs, the diff engine doesn't really care how it distributes the added versus the unchanged space characters (technically, any way of doing it is correct). I've made a change now that forces added or removed tokens to always appear before unchanged tokens tokens that are equal. The only practical difference made by this change that I can think of is the indentation issue that you're bringing up here.

share|improve this answer

I just got this absurd example, where what (as far as I can tell) was just a suggestion adding indentation to a code block resulted in a diff that made it look as though almost all the code had been drastically rewritten:

enter image description here

This is a problem when reviewing these edits because if the user suggesting the edit has changed things other than the indentation, I need to be able to see and review them. In this case, I glanced over the diff, figured it looked like nothing but formatting had changed, and decided to trust the user's edit comment that made no mention of any changes other than code formatting.

But honestly, since I didn't carefully diff it line-by-line myself, I might have just approved all kinds of blatant vandalism, and if that's the case, then I'll probably never know that I did so.

share|improve this answer
This is a valid point, but not directly related to this particular question; more to… – balpha Jan 29 '15 at 10:46
This is fixed now via…. – balpha Jun 19 '15 at 21:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .