New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File diff Ignore Trim Whitespace turn off if no difference found #45131
Comments
@alexandrudima I'd like to take on this issue. Would you be able to point me in the right direction? |
Initially I had the same behavior as you, but unless I'm mistaken, I've found a fix. I've been hunting around for the source of this issue for a few hours now, and it led me to discovering that there's an explicit variable in the code called Eventually I realized that there is a button in the diff editor (looks like a paragraph mark), which when hovered over displays a tooltip that reads "Ignore Trim Whitespace". When I click this, it fixes this behavior for me, and I can now see the whitespace in the diff exactly as I would expect. Hopefully this fixes it for you too, but if it doesn't let me know and I can look into it further. |
@danielfrankcom |
When you add the tab, it shows up in the source control tab right? Even if the tab was the only thing that changed in the file? Can you send me 2 screenshots of your diff with the 'whitespace button' on and off? Mine will still show the tab even if it's the only thing in the file. Perhaps I'm misunderstanding what you're saying, or perhaps it's much harder to reproduce than originally stated. As a side note, the whitespace button seems to have a different appearance now. |
@danielfrankcom |
Any other thought on this moderators? It would make sense to change the default view to me, considering Git shows spaces by default in its diff. |
The above is all good and I wouldn't want to change anything. The problem occurs when:
IMHO, the solution is to present a message saying "these files differ only in terms of whitespace, which is now ignored" or something along these lines. |
@alexandrudima VSCode could do much more than that with ease, be more user friendly than just present a message like it's 1990. The diff editor could detect if there are only whitespace differences, and then it could dynamically temporarily turn off Hoping to see it one day! 👍 |
Ah and by the way a toolbar button in diff editor for easy toggling Thanks! |
@gjsjohnmurray thank you for the explanation and support of my proposal. Now, I don't think I'll be able to prepare the fix myself, so I hope a developer familiar with the code base or having sufficient time will jump in :) |
… whitespace only changes and whitespace is ignored
Steps to Reproduce:
Expected: see changes
Actual: don't see any changes
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: