# Custom Code Folding - Conflict with existing fold regions

**URL:** <https://platform.jetbrains.com/t/custom-code-folding-conflict-with-existing-fold-regions/713>\
**Category:** IntelliJ Platform\
**Created:** [February 26, 2025, 10:17am UTC](https://platform.jetbrains.com/t/custom-code-folding-conflict-with-existing-fold-regions/713 "2025-02-26T10:17:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SIA51](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/sia51/32/635_2.png) [@SIA51](https://platform.jetbrains.com/u/SIA51)\
**Post date:** [February 26, 2025, 10:17am UTC](https://platform.jetbrains.com/t/custom-code-folding-conflict-with-existing-fold-regions/713/1 "2025-02-26T10:17:19Z")

</div>

Hello,

I’m trying to enable folding for code blocks of the following format:

```auto
// &begin[*name*]
...
// &end[*name*]

```

The problem I’m facing is that exisiting fold regions seem to have a higher priority in some cases. For example, when this block is folded:

```auto
// &begin[Blank]
// ...normal comment...
(...some code...)
// &end[Blank]

```

it looks like this:

```auto
//...
(...some code...)
// &end[Blank]

```

But I want the entire block (from the begin to the end marker) to be folded.

I would appreciate some guidance on how to solve this issue. Thanks!
