We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

access to lexems in a collapsed region

When a certain key is pressed in the editor, I use the EditControl's GetLine method to scan all lines above the current line picking out particular lexems of interest for a context choice prompt.

This technique works well except when there is a collapsed region somewhere above the current line. The line with the collapsed region has a special lexem that appears to represent the collapsed region. The lexem's Collapser property is non-null but doesn't appear to have any way to get to the lexems inside of the region.

Is there a way to gain access to the lexems inside of a collapsed region without first expanding it?

thanks,
Travis

4 Replies

AD Administrator Syncfusion Team January 23, 2007 12:19 AM UTC

Hi Travis,

It is possible to access the lexems inside a collapsed region.I have attached a sample that illustrates this. Let me know if this meets your requirements.

Thanks for your patience.

Regards,
Ebenezer.P

sample


AD Administrator Syncfusion Team January 28, 2007 03:33 PM UTC

Thanks Ebenezer. To sum up your sample, the way to get access to lexems in collapsed regions is to create a secondary EditControl set with the .Text of the original control. This secondary control has all regions expanded by default and therefore has access to all lexems. The downside is the potential performance hit in parsing the complete text a second time just to get access to a few collapsed regions. Kind of a hack but works for me for now.

-travis


AD Administrator Syncfusion Team March 7, 2007 12:30 AM UTC

Hi Ebenezer,

I'm using the hidden edit control technique you described previously. It has largely worked for me but now I notice that with a certain data file it crashes on the second use of the technique for some reason. The crash is on this line:

expandedEditor.Text = editor.Text;

Attached is the stack trace.

Any ideas?



stack-trace.zip


AD Administrator Syncfusion Team March 7, 2007 04:15 PM UTC

Hi Travis,

I have tested for this issue using version 4.4.0.51 and was not able to see the problem. This is how I went about testing this issue :

1.Run the attached sample.

2.Click Lexems several times.

3.Exception is not thrown.

Please let me know if I am missing something. Also, Could you please let me know the version of Essential Studio being used by you.

Thanks for your patience.

Regards,
Ebenezer.P

sample

Loader.
Live Chat Icon For mobile
Up arrow icon