A minor outlining problem

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Kasper
Avatar
Hi,

One of my users reported this, and I must agree that it's a bit annoying. It's related to the PHP outlining, but I have changed it to C#, because it will probably be easier for you to test :)

Add the following piece of C# code somewhere in the demo app editor:

if(test)
{
    Console.Write("test");
}
Fold the if statement. Now, go to the line above the if statement, and start a multiline comment ( /* ) - this will cause the code to get unfolded, which can surely be quite annoying if you have like 30 lines of code folded. I do see _why_ SyntaxEditor does this, but can anything be done to prevent it, or would that simply not make sense?

[Modified at 10/05/2006 06:51 AM]

Comments (5)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Looks like this is a minor bug. Just tested in v3.1 and didn't happen there. We'll mark it down on the TODO list. Thanks!


Actipro Software Support

Posted 18 years ago by Kasper
Avatar
Hi,

Just so I know we're talking about the same thing, I'm using version 3.1.0212 for this :). The problem is a bit worse with PHP btw, where you can stop the outlining by entering a string.
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I apologize, I midread what you wrote and found a minor bug in 4.0 in the process. :)

I see your issue now. Hmm... I'm not sure what we could do to handle that since at the time you type the /* the text below it becomes part of the comment and therefore should be expanded.

The same thing happens in Visual Studio. Like if you type /* before a collapsed method and wait a second, it will expand the collaped method. The delay is since it does parsing like our C# add-on does, which is in a separate thread. So sometimes you are able to type the whole comment before the outlining gets updated and that allows the node to remain collapsed. But in v3.1 "dynamic" languages, the outlining is done sequentially right after lexing so the change occurs immediately.

Did I explain that correctly?


Actipro Software Support

Posted 18 years ago by Kasper
Avatar
Yes, you explained it just fine. However, users are really complaining about this, especially because it happens with all folded code. For instance, folding a bunch of CSS selectors, just to see them all get unfolded because you create a new selector, is really dissatisfying. I just Google'd for another editor with CodeFolding/Outlining, and the first one does handle this better (UltraEdit32). I'm sure there are a dozen differences, and of course their syntaxhighlighting is not very pretty compared to yours, but it proves to me that it can be done. I must admit that I'm drawing a blank when thinking of ways to fix this in SyntaxEditor, but I was hoping you would be able to come up with something. Perhaps it would be possible to simply not change anything about existing codefolded blocks? I don't know, but I really hope you can come up with something :(
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Kasper,

I just checked out UltraEdit to see what they do and while their implementation doesn't have this issue, the other aspects of their implementation aren't really very good.

For instance if I type /* on one like and */ on a few lines later then collapse it, the region collapses properly. However then I can start typing anything on the */ line (even wiping out the */ token) and the collapsed lines don't expand. It seemed like the only way I could get them to expand was to click the outlining box. Maybe some people like it that way but if you wipe out the end delimiter of a collapsed node, in our view it should expand (which is what VS does).

I suppose it's a give and take thing. UltraEdit's outlining will never be guaranteed to be in sync with the contents of the document but they don't suffer from this issue.

We'll continue pondering if there's anything that can be done however, I think it's either one way or the other in how you do your implementation and we chose to do it more like VS.


Actipro Software Support

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.