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:
- url ‐ the actual file to open (i.e. a file://... URL), if you leave out this argument, the frontmost document is implied.
- line ‐ line number to go to (one based).
- column ‐ column number to go to (one based).
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:
We want to change this last <td> to the following
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.