[TxMt] Re: Changing the selection in a script/command
Allan Odgaard
mailinglist at textmate.org
Sat Oct 11 12:42:21 UTC 2014
On 7 Oct 2014, at 21:42, Richard Drake wrote:
> It's easy enough to change the current selection with a macro but is
> it
> possible in a command written in Ruby?
If you want to insert partially selected text then you can insert as
snippet and use the snippet syntax to make parts selected.
If you only want to select things in the document (and not insert
anything) then (in ruby) you can call:
%x{ "$TM_MATE" -l«selection» }
Here «selection» should be a string in the format described here
http://manual.textmate.org/references.html#selection-string
Be aware though that such command should be asynchronous, since normally
TextMate would wait for your command to finish and use its result to
change the document/selection (which you do not want here).
More information about the textmate
mailing list