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

Add initial LineCompare component with line numbers. #14

Merged

Conversation

rars
Copy link
Contributor

@rars rars commented Jul 16, 2017

I'd like to add to this library something that is similar to a line diff you might find in a diffing tool for code reviews. This is related to issue #3 and #2.

This PR is an initial concept. It adds CSS classes so that it is easier for clients to customise the appearance of the diff. I'd like to improve it further by adding an option for only showing the context around actual diffs, e.g. showing +/- 5 lines above and below an Insert/Delete but hiding the rest of the Equal portions. This makes it easier to review diffs of large files that only have a few changes.

I thought I'd raise this PR to see if anyone had any thoughts on this before spending too much time on it.

It can be used like the following:

<dmp-line-compare [left]="left" [right]="right"></dmp-line-compare>

Here is an example of the result in Chrome:
image

@elliotforbes elliotforbes merged commit a8f6eb3 into elliotforbes:master Jul 16, 2017
@btang28
Copy link

btang28 commented Feb 22, 2018

Hi,

I tried testing this with an xml compare, instead of having them compare line by line, it sort of compared the entire file.

compare

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.

3 participants