Skip to content

Code Comments Folding Block Issue - Please Help! #259

@mattbriggsuk

Description

@mattbriggsuk

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?

  • Introduce an overload within the SetFoldingMarkers method to indicate no sub-folding blocks?
  • Do something within fctb_VisibleRangeChanged, fctb_VisibleRangeChangedDelayed, fctb_TextChangedDelayed etc.?
  • Do something with the fctb.FindEndOfFoldingBlockStrategy ?
  • Something else?

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions