void DrawEolMarker (Cairo.Context cr, DocumentLine line, bool selected, double x, double y)
{
if (!textEditor.Options.IncludeWhitespaces.HasFlag (IncludeWhitespaces.LineEndings))
return;
Pango.Layout layout;
Pango.Rectangle rect;
var index = GetEolMarkerIndex (line.UnicodeNewline);
layout = eolMarkerLayout [index];
rect = eolMarkerLayoutRect [index];
cr.Save ();
cr.Translate (x, y + System.Math.Max (0, LineHeight - rect.Height - 1));
var col = ColorStyle.PlainText.Foreground;
if (selected && !SelectionColor.TransparentForeground) {
col = SelectionColor.Foreground;
} else {
if (line != null && line.NextLine != null && line.NextLine.StartSpan != null && line.NextLine.StartSpan.Count > 0) {
var span = line.NextLine.StartSpan.Peek ();
var chunkStyle = ColorStyle.GetChunkStyle (span.Color);
if (chunkStyle != null)
col = ColorStyle.GetForeground (chunkStyle);
}
}
cr.SetSourceRGBA (col.R, col.G, col.B, whitespaceMarkerAlpha * 1.4); // needs to more opaque due to font rendering
cr.ShowLayout (layout);
cr.Restore ();
}