If you plan to write FoldingText extensions you really need to learn how to use the debugger. The small up front investment of figuring it out will save you a lot of time and frustration.
FoldingText is built using JavaScript/DOM web technologies. To debug your themes, scripts, and plugins you'll be using the standard Safari Web Inspector. This is how you get FoldingText running with an attached web inspector:
- Help > Software Development Kit
- Click the "Run Editor" link
- Click the "Inspector" toolbar item
And that's it. You can now debug your themes, scripts, and plugins. You can step into FoldingText's core code to figure out what's really going on. The view automatically reloads when you save your theme or plugin file. You can set breakpoints, etc. Click the "Refresh" toolbar item to reload the editor if you'd like to step though a particular startup sequence again.
The "Run Editor" Editor is almost exactly the same as the editor that's run for normal document. But it's not quite the same, these are some of the ways that it's different.
- It runs using FoldingText's uncompressed sources
- It allows you to open a web inspector to do debugging
- It has no "native" connection to Cocoa APIs. That means some things won't work including: spellcheck, text won't be saved when FoldingText quits, and many native menu items and keyboard shortcuts won't be used.