PavelTorgashov / FastColoredTextBox

Fast Colored TextBox for Syntax Highlighting. The text editor component for .NET.
Other
1.21k stars 463 forks source link

Code Comments Folding Block Issue - Please Help! #259

Open mattbriggsuk opened 1 year ago

mattbriggsuk commented 1 year ago

Hi,

How is it possible to disable folding blocks within code comments?

        // Code Comments
        e.SetFoldingMarkers(@"/\*(.*)", @"\*/", RegexOptions.Multiline | RegexOptions.Singleline | RegexOptions.IgnoreCase);

        // Example Code
        e.SetFoldingMarkers(@"foo",     @"bar", RegexOptions.Multiline | RegexOptions.Singleline | RegexOptions.IgnoreCase);

There should not be any folding markers against foo-bar within / / comments, .i.e:

/ foo bar /

I want to avoid using RegEx Lookbehind and Lookaheads, as this is likely to cause performance issues.

What would be the best approach?

The bug exists within the PowerfulCSharpEditor example provided:

code_comment_bug

Any help or suggestions would be greatly appreciated, as I would like to give my end-users the best user experience possible,