@@ -83,7 +83,7 @@ public static void write(UnifiedDiff diff, Consumer<String> writer) throws IOExc
8383// if it isn't, output the current set,
8484// then create a new set and add the current Delta to
8585// it.
86- processDeltas (writer ,originalLines , deltas , contextSize );
86+ processDeltas (writer ,deltas );
8787deltas .clear ();
8888deltas .add (nextDelta );
8989 }
@@ -92,7 +92,7 @@ public static void write(UnifiedDiff diff, Consumer<String> writer) throws IOExc
9292
9393 }
9494// don't forget to process the last set of Deltas
95- processDeltas (writer ,originalLines , deltas , contextSize );
95+ processDeltas (writer ,deltas );
9696
9797 }
9898if (diff .getTail () !=null ) {
@@ -102,8 +102,7 @@ public static void write(UnifiedDiff diff, Consumer<String> writer) throws IOExc
102102 }
103103
104104private static void processDeltas (Consumer <String >writer ,
105- List <String >origLines ,
106- List <AbstractDelta <String >>deltas ,int contextSize ) {
105+ List <AbstractDelta <String >>deltas ) {
107106List <String >buffer =new ArrayList <>();
108107int origTotal =0 ;// counter for total lines output from Original
109108int revTotal =0 ;// counter for total lines output from Original
@@ -112,29 +111,28 @@ private static void processDeltas(Consumer<String> writer,
112111AbstractDelta <String >curDelta =deltas .get (0 );
113112
114113// NOTE: +1 to overcome the 0-offset Position
115- int origStart =curDelta .getSource ().getPosition () +1 - contextSize ;
114+ int origStart =curDelta .getSource ().getPosition () +1 ;
116115if (origStart <1 ) {
117116origStart =1 ;
118117 }
119118
120- int revStart =curDelta .getTarget ().getPosition () +1 - contextSize ;
119+ int revStart =curDelta .getTarget ().getPosition () +1 ;
121120if (revStart <1 ) {
122121revStart =1 ;
123122 }
124123
125124// find the start of the wrapper context code
126- int contextStart =curDelta .getSource ().getPosition () - contextSize ;
125+ int contextStart =curDelta .getSource ().getPosition ();
127126if (contextStart <0 ) {
128127contextStart =0 ;// clamp to the start of the file
129128 }
130129
131- // output the context before the first Delta
132- for (line =contextStart ;line <curDelta .getSource ().getPosition ();line ++) {//
133- buffer .add (" " +origLines .get (line ));
134- origTotal ++;
135- revTotal ++;
136- }
137-
130+ // // output the context before the first Delta
131+ // for (line = contextStart; line < curDelta.getSource().getPosition(); line++) { //
132+ // buffer.add(" " + curDelta.getSource().getLines().get(line - contextStart));
133+ // origTotal++;
134+ // revTotal++;
135+ // }
138136// output the first Delta
139137getDeltaText (txt ->buffer .add (txt ),curDelta );
140138origTotal +=curDelta .getSource ().getLines ().size ();
@@ -145,13 +143,13 @@ private static void processDeltas(Consumer<String> writer,
145143AbstractDelta <String >nextDelta =deltas .get (deltaIndex );
146144int intermediateStart =curDelta .getSource ().getPosition ()
147145 +curDelta .getSource ().getLines ().size ();
148- for (line =intermediateStart ;line <nextDelta .getSource ()
149- .getPosition ();line ++) {
150- // output the code between the last Delta and this one
151- buffer .add (" " +origLines .get (line ));
152- origTotal ++;
153- revTotal ++;
154- }
146+ // for (line = intermediateStart; line < nextDelta.getSource()
147+ // .getPosition(); line++) {
148+ // // output the code between the last Delta and this one
149+ // buffer.add(" " + origLines.get(line));
150+ // origTotal++;
151+ // revTotal++;
152+ // }
155153getDeltaText (txt ->buffer .add (txt ),nextDelta );// output the Delta
156154origTotal +=nextDelta .getSource ().getLines ().size ();
157155revTotal +=nextDelta .getTarget ().getLines ().size ();
@@ -162,12 +160,12 @@ private static void processDeltas(Consumer<String> writer,
162160// Now output the post-Delta context code, clamping the end of the file
163161contextStart =curDelta .getSource ().getPosition ()
164162 +curDelta .getSource ().getLines ().size ();
165- for (line =contextStart ; (line < (contextStart +contextSize ))
166- && (line <origLines .size ());line ++) {
167- buffer .add (" " +origLines .get (line ));
168- origTotal ++;
169- revTotal ++;
170- }
163+ // for (line = contextStart; (line < (contextStart + contextSize))
164+ // && (line < origLines.size()); line++) {
165+ // buffer.add(" " + origLines.get(line));
166+ // origTotal++;
167+ // revTotal++;
168+ // }
171169
172170// Create and insert the block header, conforming to the Unified Diff
173171// standard