IFormattedLine AddLineTransform(IFormattedLine line, double yPosition, ViewRelativePosition placement) { if (line != null) { var lineTransform = lineTransformProvider.GetLineTransform(line, yPosition, placement); if (lineTransform != line.LineTransform) { line.SetLineTransform(lineTransform); line.SetChange(TextViewLineChange.NewOrReformatted); } } return(line); }
IFormattedLine?GetLineAfter(IFormattedLine line) { var physLine = GetPhysicalLine(line); int index = physLine.Lines.IndexOf(line); if (index < 0) { throw new InvalidOperationException(); } if (index + 1 < physLine.Lines.Count) { return(physLine.Lines[index + 1]); } if (physLine.IsLastLine) { return(null); } physLine = GetPhysicalLine(physLine.BufferSpan.End); return(physLine.Lines[0]); }
IFormattedLine?GetLineBefore(IFormattedLine line) { var physLine = GetPhysicalLine(line); int index = physLine.Lines.IndexOf(line); if (index < 0) { throw new InvalidOperationException(); } if (index > 0) { return(physLine.Lines[index - 1]); } if (physLine.BufferSpan.Start.Position == 0) { return(null); } physLine = GetPhysicalLine(physLine.BufferSpan.Start - 1); return(physLine.Lines[physLine.Lines.Count - 1]); }
public LineInfo(IFormattedLine line) { Line = line; Visual = line.GetOrCreateVisual(); }
public LineInfo(IFormattedLine line, double y) { Line = line; Y = y; }
PhysicalLine GetPhysicalLine(IFormattedLine line) => toPhysicalLine[line];
IFormattedLine GetLineAfter(IFormattedLine line) { var physLine = GetPhysicalLine(line); int index = physLine.Lines.IndexOf(line); if (index < 0) throw new InvalidOperationException(); if (index + 1 < physLine.Lines.Count) return physLine.Lines[index + 1]; if (physLine.IsLastLine) return null; physLine = GetPhysicalLine(physLine.BufferSpan.End); return physLine.Lines[0]; }
IFormattedLine GetLineBefore(IFormattedLine line) { var physLine = GetPhysicalLine(line); int index = physLine.Lines.IndexOf(line); if (index < 0) throw new InvalidOperationException(); if (index > 0) return physLine.Lines[index - 1]; if (physLine.BufferSpan.Start.Position == 0) return null; physLine = GetPhysicalLine(physLine.BufferSpan.Start - 1); return physLine.Lines[physLine.Lines.Count - 1]; }
IFormattedLine AddLineTransform(IFormattedLine line, double yPosition, ViewRelativePosition placement) { if (line != null) { var lineTransform = lineTransformProvider.GetLineTransform(line, yPosition, placement); if (lineTransform != line.LineTransform) { line.SetLineTransform(lineTransform); line.SetChange(TextViewLineChange.NewOrReformatted); } } return line; }