private void StartSpans( IndentSet indents, int line, int textAt, LineSpanType lineType = LineSpanType.Normal ) { foreach (var indent in indents.GetAll()) { var firstLine = line; bool extendToTop = _options.VisibleEmpty && !_options.ExtendInwardsOnly && _lastEmptyToTextLine == 0 && line > 0; if (extendToTop) { firstLine = 0; } if (indent == textAt) { if (_options.VisibleAtTextEnd) { var span = StartSpan(firstLine, indent, lineType); span.LastLine = line; } } else if (indent < textAt) { var span = StartSpan(firstLine, indent, lineType); span.LastLine = line; } } }
private void StartSpans( IndentSet indents, int line, int textAt, LineSpanType lineType = LineSpanType.Normal ) { bool extendToTop = _options.VisibleEmpty && !_options.ExtendInwardsOnly && _lastEmptyToTextLine < 0 && line > 0; foreach (var indent in indents.GetAll()) { if (indent > textAt) { continue; } if (indent == textAt && !_options.VisibleAtTextEnd) { continue; } StartSpan(extendToTop ? 0 : line, indent, lineType); } }
public LineSpan(int first, int last, int indent, LineSpanType type) { FirstLine = first; LastLine = last; Indent = indent; Type = type; Changed = true; FormatIndex = 0; Highlight = false; }
private LineSpan StartSpan(int line, int indent, LineSpanType lineType) { var span = new LineSpan(line, line, indent, lineType); for (int i = 0; i < _activeSpans.Count; ++i) { if (_activeSpans[i] == null) { _activeSpans[i] = span; return(span); } } _activeSpans.Add(span); return(span); }