Sublime Forum

What is a "point"?

#1

I cant believe I am asking this, apologies in advanced if there is a detailed description somewhere that I have not looked…

The Api Page - [sublimetext.com/docs/2/api_reference.html] talks over and over about “points” but I dont see any description there about what they are.
Is it possible to create a point from row col?. Or how do we get point/rowcol from region?

0 Likes

#2

[quote]rowcol(point) (int, int) Calculates the 0 based line and column numbers of the point. text_point(row, col) int Calculates the character offset of the given, 0 based, row and column. Note that 'col' is interpreted as the number of characters to advance past the beginning of the row.[/quote]

You get a point using the text_point function.

0 Likes

#3

Ah I didn’t realise that point was just a plain offset. Thanks !

0 Likes