[TxMt] Few extensions to C Bundle

Allan Odgaard allan at macromates.com
Thu Sep 15 15:47:31 UTC 2005


On 15/09/2005, at 17.03, Wezzy wrote:

>> Actually I also do that a lot myself, and so far has just been to
>> lazy to write a generic command to call gcc on the file (and pretty
>> print errors).
> writing something that read gcc error like the python bundle could be
> useful.

Here's a very simple version:

     echo '<pre>'
     g++ "$TM_FILEPATH" \
      2> >(perl -pe 's|^.*?:(\d+):\s*(.*?)$|<a href="txmt://open?line= 
$1">$2</a>|')

Set output to Show as HTML.

It redirects stderr (2>) to a perl one-liner which convert lines of  
the form: «something
»:«line»:«something» into an txmt://-link that  
points to «line» (in current buffer).

So this gives you clickable errors, as long as the format is as above.




More information about the textmate mailing list