Outlining Node disappearing?

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by Tim Davis
Avatar
I'm using thie editor for modifying inno setup files, they use different sections. [setup] [code] etc... Each section is outlined by starting with the key (ie [setup]) and ending on a blank new line.

Well my team doesn't like this and point out that their scripts have lots of blank lines within the sections.

Ok, So I write a regex pattern to compensate for this. So now instead of ending the section on a blank line it ends the current section when it sees one of the other valid section names. (ie, setup section would stop folding once it see's [Code])

Macro that each section's EndScope is set to.
<Macro Key="HeaderMacro" Value="(\[)(setup|code)(\])" />
This works great, but I have found an issue and I'm not sure if it's with the semantic parser or with the control itself.

This is a image of the editor with the folding useing the new method (stop on instance of next section) with the nodes expanded

This is an image of the editor when the first node is collapsed, upon collapsing the first node it completely removes the next node from the document.

Is this a semantic parser or control issue?

Also, using this method is it possible that when the current section sees the stop folding tag (ie begining of next section), if the section ends and there are lets say 3 blank lines that are in the current outline (at the end, just before the next section tag) that I could tell it programaticly to ignore the blank lines and stop the folding at the last actual code line?

[Modified at 04/06/2005 04:07 PM]

Comments (9)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Did you make your own semantic parser to do the outlining?

I think the problem could be that you are making a node start and end on the same header Token, which is not permitted. Try this, make the end Token still be blank line but add a look-ahead for the header stuff. That way you don't consume the header and it will let the next header be a start node.

We don't currently have a way to have a different range for nodes and where things fold (i.e. ignoring blank lines).


Actipro Software Support

Posted 19 years ago by Tim Davis
Avatar
I am having it look for a lineterminator while looking ahead for the header. See sample below.
<Scopes>
            <Scope>
                <ExplicitPatternGroup Type="StartScope" Token="SetupStartToken" Style="SectionHeaderStyle" LookAhead="{NonWordMacro}">
                    <ExplicitPatterns>
                        [Setup]
                    </ExplicitPatterns>
                </ExplicitPatternGroup>
                <RegexPatternGroup Type="EndScope" Token="SetupEndToken" PatternValue="{LineTerminatorMacro}" LookAhead="{HeaderMacro}" IsWhitespace="False" />
            </Scope>
        </Scopes>
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
That's what I would expect to work. I'm not sure what the problem could be then.


Actipro Software Support

Posted 19 years ago by Tim Davis
Avatar
Right,

It doesn't make sense.

I did a document.outlinging.rootnode.count to see if there where still 2 child nodes when the setup node hides the code node. Well the control is still reporting two nodes and both nodes outlining properties say that the node is visible.

If you think this could be a bug with the control I will gladly send you my semanticparser class and language file.
Posted 19 years ago by Tim Davis
Avatar
I've also done a startoffset and endoffset comparison of each node. I can't remember the actual numbers but they where only one digit off.

For example:

Setup Node
StartOff = 1
EndOff = 100

Code Node
StartOff = 101
EndOff = 200
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
That looks like it should work fine. Go ahead an e-mail us your data.


Actipro Software Support

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks for the sample, this is now fixed for the next maintenance release. We had to make a tweak to the outlining indicator code to handle an outlining node that ends on a line feed.


Actipro Software Support

Posted 19 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Will this resolve the issue of where outlining nodes end at the end of the document?

Paste the following code at the bottom of the C# code in your sample app:

/// <summary>
/// </summary>
You'll see the vertical line that is drawn to signify the outlining node is never "hooked" back at the end of the node (it just keeps going off the document).
Posted 19 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Just an update about the last item I mentioned. The word I got from Support is that this is a separate issue to be looked at.
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.