Posted 17 years ago by Erik Pepping - RADVenture B.V
Version: 4.0.0245
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
Hi,

I have a weird problem with SpanIndicator that use ExpandOnBoundaries. Some of the spanindcators do expand at the first character of the SpanIndicator others not. This a big issue for us, because it is a show-stopper for releasing our software.

Please add the following code to the example application to reproduce:
using ActiproSoftware.SyntaxEditor;

namespace TestApplication.QuickStart
{
    class MySpanIndicator : HighlightingStyleSpanIndicator
    {
        public MySpanIndicator(string name, HighlightingStyle highlightingStyle)
            : base(name, highlightingStyle)
        {
        }

        protected override bool ExpandOnBoundaries
        {
            get
            {
                return true;
            }
        }
    }
}
Please replace line 60 from the QuickStart\IndicatorsForm.cs file with these lines:
this.AddSpanIndicator(SpanIndicatorLayer.SyntaxErrorKey, SpanIndicatorLayer.SyntaxErrorDisplayPriority,
                new MySpanIndicator("ExpandOnBoundaries SpanIndicator at beginning of the line", new HighlightingStyle("test0", "test0", Color.Transparent, Color.Red)), new TextRange(255, 268));
            this.AddSpanIndicator(SpanIndicatorLayer.SyntaxErrorKey, SpanIndicatorLayer.SyntaxErrorDisplayPriority,
                new MySpanIndicator("ExpandOnBoundaries SpanIndicator at NOT beginning of the line", new HighlightingStyle("test", "test", Color.Transparent, Color.Green)), new TextRange(268, 277));
When you run the example you will notice that the first SpanIndicator (the red one) does NOT expand automatically at the start of the SpanIndicator, but the second (the green one) does expand. In our software we use the SpanIndicators quite a lot and this behavior is seen every second SpanIndicator.

Kind regards,

Erik Pepping

[Modified at 03/21/2007 02:04 PM]

Comments (4)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
So just to make sure we're on the same page per your sample, the first red one should be expanding when you type at its start. If that is fixed you are ok, right?


Actipro Software Support

Posted 17 years ago by Erik Pepping - RADVenture B.V
Avatar
Yes, if you place the caret at the start of the red SpanIndicator it should automatically when you start typing, because of the property ExpandOnBoundaries
(just as the green SpanIndicator does).

In another example with a lot more SpanIndicators were every second SpanIndicator fails to expand just like in this example.

Thanks for the quick response!
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Erik,

This ended up being a pretty tricky bug and involved some changing of indicator adjustment code. Would you be willing to help beta test the fix prior to its official release? It all seems to be working now but it would be helpful to have you check it out too.


Actipro Software Support

Posted 17 years ago by Erik Pepping - RADVenture B.V
Avatar
Sure, that fix would make a pretty complicated workaround obsolete.

Kind regards,

Erik Pepping.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.