Search code examples
notepad++text-editorcode-foldingsqr

Explicitly say which conditions to fold Notepad++


I have a custom language for SQR and I'm trying to get the code folding feature to work for Notepad++. In SQR, the case of the keywords do not matter.

Begin-Procedure is the same as bEgIn-ProCEdure. The same goes for the traditional if ... end-if is the same as If ... End-If.

In notepad++ you can specify a code folding feature to fold the code. My problem is that I only want to specify the code to fold on if ... end-if regardless of case. Notepad++ currently tries to fold code everywhere it sees if.

Meaning, if I name a procedure with Begin-Procedure Verify-Something, the if in verify attempts to get folded leaving me with undesirable results.

How can I specifically specify I only want to fold code on the single instances of if and not wherever if is found?


Solution

  • You need to use "Folding in code 2 style (separators needed)" and make sure you have a check in "Ignore case". Also, if you have "-" in the "Operators & Delimiters" tab, make sure it's only in the "Operators 2 (separators required)" section.

    Ignore case checked

    Folding in code 2 style (separators needed)

    Example code]