Skip to content
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

Made diffprettytext replace invisibles with unicode characters #126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NickyBoy89
Copy link

Not sure is this is the best method to do this, but this PR replaces invisible characters in the Insert/Delete diffs, so that these characters can be seen and fixed, instead of not being able to tell between diffs that look the same but have unequal whitespace, which is something that I have been struggling with.

The ways that I can see to implement this are:

  • Add this functionality into the main DiffPrettyText function, where all spaces are converted into the Unicode Full Block character, and returns are replaced by the Unicode return symbol. (This PR)
  • Create an additional pretty print function that takes does similar steps (Seems to duplicate functionality, but could potentially be the easiest)
  • Modify the original function's API to add an additional boolean parameter for the function that can toggle this behavior. Out of all, this seems the most unlikely, as it would break pre-existing implementations.

chiragjn added a commit to truefoundry/go-diff that referenced this pull request Mar 3, 2023
@chiragjn
Copy link

chiragjn commented Mar 3, 2023

Bump on this, this is a very useful change @sergi
I can help if needed

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

Successfully merging this pull request may close these issues.

2 participants