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

Highlight diffs in duplicated code #57

Open
caesarsol opened this issue Mar 27, 2017 · 3 comments
Open

Highlight diffs in duplicated code #57

caesarsol opened this issue Mar 27, 2017 · 3 comments

Comments

@caesarsol
Copy link

Would be nice to highlight the identifiers/literals that are the only difference between the snippets, when one uses the -I or -L options, in a similar manner to a color diff.

They would be helpful in refactoring since I'd have an hint on what should be a parameter of the newly created function.

Have you thought about it?

@danielstjules
Copy link
Owner

We previously outputted diffs:

screenshot

However, they didn't work very well when they were n-way diffs, such that N was more than 2 instances in a match. The output was quite confusing and difficult to parse.

@caesarsol
Copy link
Author

Yeah, I actually realized this and modified the text :)

The new idea would be just a highlight on the literal/identifier that is not in common between the multiple chunks. Would that be better?

@ghost
Copy link

ghost commented Nov 17, 2018

We previously outputted diffs:

screenshot

The link is broken for me

However, they didn't work very well when they were n-way diffs, such that N was more than 2 instances in a match. The output was quite confusing and difficult to parse.

But for N=2 such a diff would be extremely useful, it can work the way it works now by default, yet resort to display diffs for N=2 if an explicit command line argument is used?

Now I have to pipe the output into vim, copy/paste the chunks by hand into temporary files and run vimdiff on them, because I don't know of a better way.

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