Outlining starting on last offset on last line

SyntaxEditor for WPF Forum

Posted 7 years ago by Xinen Lee
Version: 16.1.0635
Avatar

Hi Actipro

The outlining for our language works such that each outlining node's opening offset starts on the end of the line (because we don't have brackets in our language). However, for the last line, we are unable to add an outlining node.

 

To reproduce a similar issue:

Use the Code Outlining - Range-Based example - in JavascriptOutliningSource, for "MultiLineCommentStartDelimiter", use commentStartOffset = token.EndOffset instead of token.StartOffset.

When we run the sample application and add a "/*" on the last line, no outlining node appears - because in OutliningManager.UpdateAutomaticOutlining, it checks for (currentOffset < endOpenOffset) and does not allow adding an outlining node at endOpenOffset.

 

 

This is causing us an anomaly since we can type an opening outlining node in the last line but yet not see any outlining node appear. I know we are effectively collapsing nothing, but it just feels more complete, and user will expect an outlining node to appear upon typing the opening node.

 

Will it be possible for Actipro to fix this and include the 'endOpenOffset' please, or is it possible for us to use any workaround?

Comments (2)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Xinen,

Hmm... our outlining features weren't really designed to handle that kind of non-standard scenario.  We tested changing that condition to '<=' instead of '<' and while that allows the node to be created, if you then remove last character, it is not being recognized as removing the start node since there is other logic deeper down in the OutliningTreeWalker that doesn't have handing for this newly-introduced snapshot end scenario.

Sorry but I'm not aware of a workaround you could do at this time for this.


Actipro Software Support

Posted 7 years ago by Xinen Lee
Avatar

Thanks for looking into it.

The latest build of this product (v24.1.1) 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.