[TxMt] Re: How to put the cursor at the top of a document

Allan Odgaard mailinglist at textmate.org
Fri Feb 12 12:40:44 UTC 2016


On 11 Feb 2016, at 5:56, Koen Punt wrote:

> In the "Bundle Support" bundle in Support/shared/lib/textmate.rb 
> there's a
> go_to function, which uses the txmt:// protocol for the current file, 
> or when
> a path is supplied it uses the mate cli.

Just for the records, calling "$TM_MATE" with e.g. a --line argument w/o 
a file path will work on current file even when that file is untitled.

This is a “new” feature (2.0) and the go_to function hasn’t been 
updated to take advantage of this, thus it still falls back on txmt: for 
untitled files, but using "$TM_MATE" is more robust since a few other 
applications can claim the txmt: URL scheme.

Also, the path to the mate shell command is exposed to bundle items via 
the TM_MATE environment variable, so going via a shell interpreter it 
can be reached with: "$TM_MATE".


More information about the textmate mailing list