[TxMt] Set Selection from a tmCommand

Ciarán Walsh ciawal at gmail.com
Mon Apr 2 07:48:56 UTC 2007


On 2 Apr 2007, at 08:36, Hans-Joerg Bibiko wrote:

> would it be possible to set a selection in the current document by  
> using a tmCommand?

This can be done in a command by taking the entire document as input  
and outputting the entire document as a snippet, wrapping the  
selection you want in ${0:…}, however this is bad because since the  
entire document is being replaced the TM parser has to rescan the  
entire file. If you know you only need to select on the current line  
then you can use just that for input/output which would be more  
efficient.

Ideally you would use a macro to do such things, if it is possible.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20070402/bd209639/attachment.html>


More information about the textmate mailing list