Adjusting Existing SpanIndicators

SyntaxEditor for Windows Forms Forum

Posted 15 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
I'm currently working on implementing CodeSnippets in SE 3.0. Everything has been working great, except for the SpanIndicators used to indicate the Code Snippet Fields. Specifically, my problem deals with typing text adjacent to an indicator.

Let's say I have the following text:

blah blah FieldValue blah blah

and I have a SpanIndicator that covers the text "FieldValue" (offset = 10, length = 10).

If I type text in the middle of "FieldValue" to change it to "FieldMidValue", the SpanIndicator expands to include the typed text. This is perfect!

If I position the caret before the "F" and change "FieldValue" to "StartFieldValue", the SpanIndicator does not include my newly typed text. It still only covers "FieldValue".

Likewise, if I position the caret after the "e" and change "FieldValue" to "FieldValueEnd", the SpanIndicator does not include my newly typed text.

How do I make the SpanIndicator include the text that is typed immediately before or after it (just like the text typed in the middle)?

If there's no way to currently do this, could you consider adding any/all of the following:

1) (Prferrably) A property for the SpanIndicator class to indicate if text typed adjacent to the SpanIndicator is included or excluded from the SpanIndicator
2) Change offset/length properties to be read/write so adjustments can be made in "Document_TextChanged" event.
3) Add methods to adjust the location of the SpanIndicator so adjustments can be made in "Document_TextChanged" event.

Thanks for the help! The "KeyTyping" event in SE 3.0 has made CodeSnippets pretty easy to implement (aside from the SpanIndicator issue).

Comments (2)

Posted 15 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
Well... removing and re-adding the indicators wasn't as bad as I thought, but it would still be nice to see some of those items added to the TODO list. At any rate, I have a solution for my current problem.
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I've added a SpanIndicator.ExpandOnBoundaries property that you can override to true in your span indicator classes. This will expand the indicator when typing is on the first offset or at the end of the indicator. Also, it will let you have a zero-width indicator that can grow if you start typing over it again.


Actipro Software Support

The latest build of this product (v2018.1 build 0342) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.