void DrawIndent (Cairo.Context cr, LayoutWrapper layout, DocumentLine line, double xPos, double y)
{
if (!textEditor.Options.DrawIndentationMarkers)
return;
if (line.Length == 0) {
var nextLine = line.NextLine;
while (nextLine != null && nextLine.Length == 0)
nextLine = nextLine.NextLine;
if (nextLine != null)
layout = GetLayout (nextLine);
}
if (layout.IndentSize == 0)
return;
cr.Save ();
var dotted = new [] { textEditor.Options.Zoom };
cr.SetDash (dotted, (int)y + textEditor.VAdjustment.Value);
var top = y;
var bottom = y + LineHeight;
if (Caret.Line == line.LineNumber && textEditor.GetTextEditorData ().HighlightCaretLine) {
top += textEditor.Options.Zoom;
bottom -= textEditor.Options.Zoom;
}
for (int i = 0; i < layout.IndentSize; i += textEditor.Options.IndentationSize) {
var x = System.Math.Floor (xPos + i * charWidth);
cr.MoveTo (x + 0.5, top);
cr.LineTo (x + 0.5, bottom);
cr.SetSourceColor (ColorStyle.IndentationGuide.Color);
cr.Stroke ();
}
cr.Restore ();
}