Goodies 20: Code Folding

Since MBS Plugin 12.4 we got a long standing wish from various FileMaker developers: Code Folding.

As you know our plugin highlights matching script lines for If and Loop blocks. You see what lines belongs to what other line. When you click on an "Loop" line, we look below for the "End Loop" line and for any "Exit Loop If" line with the right indention. The same way we look for "If", "Else" and "End If" lines on the same level. And this even localized with all languages supported by FileMaker.

When we detect such a block, we add a little control between the line number and the text. You can click that small toggle control to hide some lines and later click it again to show them. Like in this video:

When you save the script, FileMaker reloads it or you start dragging a line, all lines show again. Our line hiding is only temporary until something unhides them and we intentionally don't store it as it can confuse FileMaker itself.

Hold down option key to fold a whole if block until the end if and not just until the next else.

As usual, this feature is macOS only. If you like to see a Windows version, please contact Claris Inc. directly to implement this cross platform in a future version.

The feature is available in the debugger, but stepping though the script may reveal all script lines. Basically whenever FileMaker reloads the script lines, our hidden lines show themselves.

You can hide some lines using the contextual menu using the "Hide selected" command and also reveal all lines with the "Unhide all script steps" command.

Enable it in preferences dialog or by using SyntaxColoring.SetCodeFoldingEnabled function.


Script highlight color 20 Comment Links