rangeForScreenRow


#1

Is there an equivalent to textBuffer.rangeForRow, but in screen coordinates? At the moment i actually move my cursor with textEditor.moveToEndOfScreenLine and get coordinates just to obtain the range of screenLine, i guess there is a better solution?


#2

I don’t think so, but I also don’t think there’s a problem with how you’re currently doing it.


#3

Roger that and thanks for answer.
I could see 2 advantages with a command just getting a range:

  • I guess both options are inexpensive, but i guess the one moving cursor is relatively much more expensive that just getting the range of line.

  • There could be consequences from moving the cursor, (e.g. the cursor could land at a marker, or a trigger of the cursor movement subscription etc.)