about summary refs log tree commit diff stats
path: root/cgit.css
diff options
context:
space:
mode:
authorRagnar Ouchterlony2009-10-25 18:13:22 +0100
committerLars Hjemli2009-11-07 15:37:11 +0100
commit735e15e38a484bf0daa98776fa7cde270a271cda (patch)
tree588545cead471e8997adc1ae5abca164a4873481 /cgit.css
parentFixed side-by-side diff bugs related to binary diff and more. (diff)
downloadcgit-735e15e38a484bf0daa98776fa7cde270a271cda.tar.gz
cgit-735e15e38a484bf0daa98776fa7cde270a271cda.zip
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>
Diffstat (limited to 'cgit.css')
-rw-r--r--cgit.css10
1 files changed, 10 insertions, 0 deletions
diff --git a/cgit.css b/cgit.css index 3f37165..9e6d2a4 100644 --- a/cgit.css +++ b/cgit.css
@@ -627,6 +627,11 @@ table.ssdiff td.add_dark {
627 min-width: 50%; 627 min-width: 50%;
628} 628}
629 629
630table.ssdiff span.add {
631 background: #cfc;
632 font-weight: bold;
633}
634
630table.ssdiff td.del { 635table.ssdiff td.del {
631 color: black; 636 color: black;
632 background: #fcc; 637 background: #fcc;
@@ -639,6 +644,11 @@ table.ssdiff td.del_dark {
639 min-width: 50%; 644 min-width: 50%;
640} 645}
641 646
647table.ssdiff span.del {
648 background: #fcc;
649 font-weight: bold;
650}
651
642table.ssdiff td.changed { 652table.ssdiff td.changed {
643 color: black; 653 color: black;
644 background: #ffc; 654 background: #ffc;