That part works, thanks.

What seems to have changed from TM1 is that when $TM_SELECTED_TEXT is set all of

$TM_LINE_NUMBER
$TM_LINE_INDEX
$TM_CURRENT_WORD
$TM_CURRENT_LINE

are blank. The first two at least I need. Is this a bug?



07952130635
skype: rdrake98
blog - twitter

On 11 October 2014 13:42, Allan Odgaard <mailinglist@textmate.org> wrote:
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).

_______________________________________________
textmate mailing list
textmate@lists.macromates.com
http://lists.macromates.com/listinfo/textmate