[TxMt] Re: Cursor position in bytes

Allan Odgaard mailinglist at textmate.org
Sun Aug 7 14:20:46 UTC 2016

On 6 Aug 2016, at 21:01, Jacob Carlborg wrote:

> […] This requires the commands to convert to and from cursor 
> position in bytes to cursor position in column/line number. Is this 
> information something that TextMate already has and can provide or, if 
> not, provide it in a more efficient way then the conversion performed 
> by the command?
> I would also need to be able to specify the cursor position in bytes 
> using the “mate” tool. I’ve
> also looked at the implementation of the Go bundle for the same 
> commands and it has the same issue.

If you ask TextMate to jump to offset 1,000 then I assume you expect 
this to be based on the bytes on disk, but TextMate may convert encoding 
or line delimiters when loading a file, so it would need to map the 
offset to match the memory representation.

IMHO the tool should be updated to output warnings/errors as line:column 
and not byte offset.

More information about the textmate mailing list