AvalonEdit
AvalonEdit copied to clipboard
VisualLineElementGenerator When the line ending is \t
When the line ending is \t I want to replace with the specified custom control But it will not take effect when the string is highlighted in the line content I don't know where is the problem, hope you can help me thanks a lot

`internal class TestElementGenerator : VisualLineElementGenerator { public override VisualLineElement ConstructElement(int offset) { return new InlineObjectElement(0, new TestControl()); }
public override int GetFirstInterestedOffset(int startOffset)
{
DocumentLine endLine = CurrentContext.VisualLine.LastDocumentLine;
StringSegment relevantText = CurrentContext.GetText(startOffset, endLine.EndOffset - startOffset);
int count = relevantText.Count;
if (count > 0)
{
if (relevantText.Text[count - 1] == '\t')
{
return endLine.EndOffset;
}
}
return -1;
}
}`
@sandrejev