Problem with span indicators ending on empty line

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Thomas Goff
Version: 4.0.0253
Platform: .NET 2.0
Environment: Windows XP (32-bit)
If you add the following code to the end of the MainForm constructor in your sample you will see that the span indicator does not properly draw. If you move the span indicator so it does not end on an empty line, then it draws fine.

// Set text
editor.Text = "This is a test\nof span indicators that end\non a blank line\n\n\nMore text outside the span indicator\n\n";

// Create highlight style
HighlightingStyle highlightingStyle = new HighlightingStyle("style", null, Color.Empty, Color.Empty);
highlightingStyle.BorderColor = Color.Black;
highlightingStyle.BorderStyle = HighlightingStyleLineStyle.Solid;

// Create a layer
SpanIndicatorLayer layer = new SpanIndicatorLayer("test", 1);

// Get the lines that will be in the span indicator
DocumentLine startLine = editor.Document.Lines[0];
DocumentLine endLine = editor.Document.Lines[3];

// Get the text range for the lines
TextRange textRange = new TextRange(startLine.StartOffset, endLine.EndOffset);

// Create a highlight span indicator
HighlightingStyleSpanIndicator indicator = new HighlightingStyleSpanIndicator("indicator",
layer.Add(indicator, textRange);

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Thanks Thomas, this is now fixed for the next maintenance release.

Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.