In side-by-side diff, add support for marking individual characters.
Refuses to do so if the left hand side of the diff has different amount of differing lines to the right hand side to avoid confusion. Note that I use the naive dynamic programming approach for calculating the longest common subsequence. We could probably be more efficient by using a better algorithm. The LCS calculating function is O(n*m) and uses up n*m amount of memory too (so if we we compare two strings of length 100, I use an array of 10000 for calculating the LCS). Might want to not calculate LCS if the length of the line is too large. Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
This commit is contained in:

committed by
Lars Hjemli

parent
4a198e4b8e
commit
735e15e38a
10
cgit.css
10
cgit.css
@ -627,6 +627,11 @@ table.ssdiff td.add_dark {
|
||||
min-width: 50%;
|
||||
}
|
||||
|
||||
table.ssdiff span.add {
|
||||
background: #cfc;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.ssdiff td.del {
|
||||
color: black;
|
||||
background: #fcc;
|
||||
@ -639,6 +644,11 @@ table.ssdiff td.del_dark {
|
||||
min-width: 50%;
|
||||
}
|
||||
|
||||
table.ssdiff span.del {
|
||||
background: #fcc;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.ssdiff td.changed {
|
||||
color: black;
|
||||
background: #ffc;
|
||||
|
Reference in New Issue
Block a user