[TxMt] Re: Range of selection string / environment variable TM_SELECTION
Allan Odgaard
mailinglist at textmate.org
Thu Jan 16 03:29:11 UTC 2014
On 15 Jan 2014, at 20:57, Kai Wood wrote:
> TM_SELECTION is now "6-3”, the range now includes line 6, but the
> *visible* part of the selection is still 3-5 […] Can this be
> considered a bug or is it intended behavior / a feature?
I believe it is correct behavior.
Line 6-3 is short for 6:1-3:1.
This means the selection goes from line 3, column 1, to line 6, column
1.
As you say yourself, you can check if the newline is included, to test
if the last line in the selection is an “empty line”. Had the
newline not been included in the selection, TM_SELECTION would be 5:5-3.
I.e. starting at line 3, column 1, and ending on line 5, column 5
(including all characters on line 5 except the trailing newline).
More information about the textmate
mailing list