@@ -105,6 +105,32 @@ public override void Render(DrawingContext context)
105
105
continue ;
106
106
107
107
var y = line . GetTextLineVisualYPosition ( line . TextLines [ 0 ] , VisualYPosition . LineMiddle ) - view . VerticalOffset ;
108
+
109
+ var prefix = null as FormattedText ;
110
+ if ( info . Type == Models . TextDiffLineType . Added )
111
+ {
112
+ prefix = new FormattedText (
113
+ "+" ,
114
+ CultureInfo . CurrentCulture ,
115
+ FlowDirection . LeftToRight ,
116
+ typeface ,
117
+ presenter . FontSize ,
118
+ Brushes . Green ) ;
119
+ }
120
+ else if ( info . Type == Models . TextDiffLineType . Deleted )
121
+ {
122
+ prefix = new FormattedText (
123
+ "-" ,
124
+ CultureInfo . CurrentCulture ,
125
+ FlowDirection . LeftToRight ,
126
+ typeface ,
127
+ presenter . FontSize ,
128
+ Brushes . Red ) ;
129
+ }
130
+
131
+ if ( prefix != null )
132
+ context . DrawText ( prefix , new Point ( 0 , y - prefix . Height * 0.5 ) ) ;
133
+
108
134
var txt = new FormattedText (
109
135
lineNumber ,
110
136
CultureInfo . CurrentCulture ,
@@ -126,7 +152,7 @@ protected override Size MeasureOverride(Size availableSize)
126
152
var maxLineNumber = presenter . GetMaxLineNumber ( ) ;
127
153
var typeface = TextView . CreateTypeface ( ) ;
128
154
var test = new FormattedText (
129
- $ "{ maxLineNumber } ",
155
+ $ "- { maxLineNumber } ",
130
156
CultureInfo . CurrentCulture ,
131
157
FlowDirection . LeftToRight ,
132
158
typeface ,
0 commit comments