Skip to content

Whitespace visualization in diffs? #63

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

Closed
vlsi opened this issue Nov 21, 2019 · 4 comments
Closed

Whitespace visualization in diffs? #63

vlsi opened this issue Nov 21, 2019 · 4 comments

Comments

@vlsi
Copy link

vlsi commented Nov 21, 2019

Code formatting often involves "extra whitespace" or "missing whitespace" or "CRLF vs LF" issues.
Unfortunately, whitespace is not visible by default.

What if there was an option to visualize the whitespace that contributes to the diff?

For instance: use ␍␊ characters when output encoding allows. Use · for space visualization, and so on.

Note: the point is not "visualize all the whitespace characters", but "visualize only those chars that contribute to the diff".

@wumpz wumpz pinned this issue Jan 10, 2020
@wumpz
Copy link
Collaborator

wumpz commented Feb 21, 2020

Since I have no clue what kind of (character) modifications someone could possibly think of, I will implement some kind of extension point.

@vlsi
Copy link
Author

vlsi commented Feb 21, 2020

Oh,

By the way, I use ␍␊ in https://github.com/autostyle/autostyle, and it works great so far.

@vlsi
Copy link
Author

vlsi commented Feb 21, 2020

Just in case, my experience with Windows console is it is extremely hard to output the proper characters.
That is, I just resort to \n and \r when running on Windows no matter what the default encoding is and so on :-/

@wumpz wumpz closed this as completed in df01ef6 Feb 23, 2020
wumpz added a commit that referenced this issue Feb 23, 2020
@wumpz
Copy link
Collaborator

wumpz commented Feb 23, 2020

Now you could set a processDiffs function to process the diffed text to replace the text. Look at the corresponding test: DiffRowGeneratorTest.testReplaceDiffsIssue63.

wumpz added a commit that referenced this issue Feb 23, 2020
wumpz added a commit that referenced this issue Feb 23, 2020
@wumpz wumpz unpinned this issue Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants