[TxMt] Little problem with c++ macro

Allan Odgaard throw-away-1 at macromates.com
Sat Apr 22 00:05:14 UTC 2006


On 21/4/2006, at 17:26, José Manuel wrote:

> [...] I have tried with this line at the end of the command (which  
> is in Ruby):
>
> `/usr/local/bin/mate "$TM_FILEPATH" -l $CARET'`
>
> but it makes TextMate freeze.

I assume $CARET is the new line number? Try instead this (I wrapped  
$CARET as I think you meant it to be):

    `/usr/local/bin/mate "$TM_FILEPATH" -l #{$CARET} 2>/dev/null &`

An alternative approach is the “replace document with snippet” as  
recently discussed [1].

Inspired by this letter, I put a macro in the C bundle which inserts  
missing includes in the top of the document. The key equivalent is  
ctrl-# -- it’s not perfect, but it’s a good start :)


[1] http://lists.macromates.com/pipermail/textmate/2006-April/ 
009742.html




More information about the textmate mailing list