Sublime Forum

Odd results with view.text_point

#1

I am getting odd results with view.text_point returning the point on the following line, for instance if I run

view.text_point(3, 10)

It will return the point at (4,10) etc, so if I call it I have to do.

view.text_point(line# - 1, 10) to get expected results.

I’m guessing maybe inside, the labeling is:
Line 0: XXX
Line 1: XXX
Line 2: XXX
Line 3: XXX

So if I ask for Line 3, I’m expecting Line 2 to be what is returned.

On Build 2121, maybe someone can confirm if its not just me? If it is then I suppose I’m doing something wrong

0 Likes

#2

That’s by design - rows and columns both start from 0. The gutter and status bar calculate the displayed values by adding 1 to them.

0 Likes