@@ -613,20 +613,29 @@ private void ShowComparison(bool forceBinary = false, bool sideBySide = true)
613613
614614 oldRtfBuilder . Append ( $ "{ lineNumber } ", LINE_COLOR ) ;
615615 oldRtfBuilder . Append ( $ " ") ;
616- newRtfBuilder . Append ( $ "{ lineNumber } ", LINE_COLOR ) ;
617- newRtfBuilder . Append ( $ " ") ;
616+ if ( sideBySide )
617+ {
618+ newRtfBuilder . Append ( $ "{ lineNumber } ", LINE_COLOR ) ;
619+ newRtfBuilder . Append ( $ " ") ;
620+ }
618621
619622 switch ( cmpr . DiffType )
620623 {
621624 case DiffType . Added :
622625 _addPerc . Add ( ( double ) scrollLineMarker / ( double ) maxPerc ) ;
623- oldRtfBuilder . AppendLine ( $ "{ stringFiller } ", ADD_COLOR ) ;
624- newRtfBuilder . AppendLine ( $ "{ lineString } ", ADD_COLOR ) ;
626+ if ( sideBySide )
627+ {
628+ oldRtfBuilder . AppendLine ( $ "{ stringFiller } ", ADD_COLOR ) ;
629+ newRtfBuilder . AppendLine ( $ "{ lineString } ", ADD_COLOR ) ;
630+ }
631+ else
632+ oldRtfBuilder . AppendLine ( $ "{ lineString } ", ADD_COLOR ) ;
625633 break ;
626634 case DiffType . Deleted :
627635 _delPerc . Add ( ( double ) scrollLineMarker / ( double ) maxPerc ) ;
628636 oldRtfBuilder . AppendLine ( $ "{ lineString } ", DELETE_COLOR ) ;
629- newRtfBuilder . AppendLine ( $ "{ stringFiller } ", DELETE_COLOR ) ;
637+ if ( sideBySide )
638+ newRtfBuilder . AppendLine ( $ "{ stringFiller } ", DELETE_COLOR ) ;
630639 break ;
631640 case DiffType . Modified :
632641 _modPerc . Add ( ( double ) scrollLineMarker / ( double ) maxPerc ) ;
@@ -644,24 +653,30 @@ private void ShowComparison(bool forceBinary = false, bool sideBySide = true)
644653 switch ( b . DiffType )
645654 {
646655 case DiffType . Added :
647- newRtfBuilder . Append ( $ "{ b . Str } ", ADD_COLOR ) ;
656+ if ( sideBySide )
657+ newRtfBuilder . Append ( $ "{ b . Str } ", ADD_COLOR ) ;
658+ else
659+ oldRtfBuilder . Append ( $ "{ b . Str } ", ADD_COLOR ) ;
648660 break ;
649661 case DiffType . Deleted :
650662 oldRtfBuilder . Append ( $ "{ b . Str } ", DELETE_COLOR ) ;
651663 break ;
652664 case DiffType . Modified :
653665 case DiffType . None :
654666 oldRtfBuilder . Append ( $ "{ b . Str } ", MODIFIED_COLOR ) ;
655- newRtfBuilder . Append ( $ "{ b . Str } ", MODIFIED_COLOR ) ;
667+ if ( sideBySide )
668+ newRtfBuilder . Append ( $ "{ b . Str } ", MODIFIED_COLOR ) ;
656669 break ;
657670 }
658671 }
659672 oldRtfBuilder . AppendLine ( "" ) ; // add carriage return
660- newRtfBuilder . AppendLine ( "" ) ; // add carriage return
673+ if ( sideBySide )
674+ newRtfBuilder . AppendLine ( "" ) ; // add carriage return
661675 break ;
662676 default :
663677 oldRtfBuilder . AppendLine ( $ "{ lineString } ") ;
664- newRtfBuilder . AppendLine ( $ "{ lineString } ") ;
678+ if ( sideBySide )
679+ newRtfBuilder . AppendLine ( $ "{ lineString } ") ;
665680 break ;
666681 }
667682 prevLineSize = lineString . Length ;
@@ -806,10 +821,10 @@ private void ShowComparison(bool forceBinary = false, bool sideBySide = true)
806821
807822 this . OldAsciiContent . Rtf = oldRtfBuilder . GetDocument ( ) ;
808823
809- if ( sideBySide || ! useBinary )
824+ if ( sideBySide )
810825 this . NewAsciiContent . Rtf = newRtfBuilder . GetDocument ( ) ;
811826
812- this . SplitContainer1 . Panel2Collapsed = ! sideBySide && useBinary ;
827+ this . SplitContainer1 . Panel2Collapsed = ! sideBySide ;
813828
814829 EnableButtons ( ) ;
815830 InvalidateAll ( ) ;
0 commit comments