Outlining in a single line

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Alexey Chuikov - Project Tech Leader. Custom Development, Quest Software
Version: 4.0.0253
Avatar
Hello Actipro Software Team!

I've recently tried automatic outlining using Actipro SyntaxEditor control v4.0.0253 and noticed that control creates an outlining node even if open and close bracket token are in the same line. I've found it annoying because I'm adapting control for using with PowerShell language and this language often contains such code as
$Form.Add_Shown({$form.Activate()})
i.e. open and close curly braces in the same line. There is no need to collapse this such small part of code but SyntaxEditor control treats it as a usual code block and creates outlining indicator for it.

I've tried to hide unnecessary outlining marks setting OutliningNode's ParseData.IndicatorVisible property in OnDocumentAutomaticOutliningComplete overridden method but it seems that this property hides/shows outlining indicator only on the next PerformAutomaticOutlining pass.

Is there any chance to override this standard behavior?
I need your advise. What do you think?

Thanks in advance,
Alexey

Comments (2)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Right now we don't have a built in way to not show indicators where the node is on one line. This is something we hope to add in future versions.

But perhaps you could change your GetTokenOutliningAction code (I assume you're using a dynamic language) so that it doesn't return an outlining action if the token is on the same line as the matching token? For this you would need to do some token scanning in that method and quit when you reach line ends.


Actipro Software Support

Posted 17 years ago by Alexey Chuikov - Project Tech Leader. Custom Development, Quest Software
Avatar
Thank you for idea. I thought it would be not so easy to implement parsing logic in GetTokenOutliningAction, but it turned out to be quite simple: just find the next(previous) matching brace and check if it is in the same line. It works!

Thanks,
Alexey.
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.