AndyJarrett

Opening Textmate from cfdebugging output

Opening textmate from cfdebugging output

I use CFBuilder and Textmate ( with CFTextMate) for my web development needs. While CFBuilder is is a great tool it lacks (and this is thanks to the underlying Eclipse IDE) speed and that is when I use Textmate as I can open up a file from the Terminal quickly with the command mate ~/Sites/somesite/someFileWithError.cfm.

What I have always wanted to do is launch Textmate direct from the HTML output on a page and luckily you can do this with TextMates URL Scheme.

The format is: txmt://open?[url=file]&[line=linenumber]&[column=columnnumber] with the arguments:

If you have Textmate installed click on the following link to open /etc/hosts, this href is simply txmt://open?url=file:///etc/hosts.

So far pretty cool, but we can now take this one step further and edit a template listed on the debugging output so we can quickly access and update a template without reverting back to CFBuilder. The next set of instructions are for Railo but are easily applied to other engines.

In Railo I am going to change the /railo-context/templates/debugging/debugging-neo.cfm template around line 1110 which should currently looks like this:

#pages.src#

We want to change this last <td> to the following

#pages.src#

All you need to do now is select the debugging-neo.cfm template from your web context admin, restart Railo, and you are good to go.

After this you could then create a Texmate <a> link on a CFML error template, allowing you to quickly jump to a line and edit a problem.