[Bug] When Diff is all-whitespace, toggling 'Ignore Whitespace Changes' Off won't work (original) (raw)

Currently, when a diff contains only whitespace changes, then Ignore Whitespace Changes can only be toggled On - trying to toggle it Off will do nothing!

The reason is that when On, the Content is no longer a (descendant of) class TextDiffContent but the (standalone) class NoOrEOLChange. To fix this, the if-condition could be moved down to cover just the last part, where the TextDiffContent ctx is actually used/required...

Image

On a much related note, the toggle button for Ignore Whitespace Changes needs to be moved "two steps" to the right, so that it doesn't move sideways when toggling it (in the case of an all-whitespace Diff).

When Off, it's the 4th button from the right:
Image

When On, it's the 2nd button from the right:
Image

Having a toggle-button "jump around" when toggling it is bad design and very annoying - the user should be able to keep toggling the button On and Off (without moving the mouse pointer) to see the effect it has. (In this case, the second toggle-click could end up on the Side-by-Side Diff toggle button which takes its place.)