posAtCoords

abstract fun posAtCoords(x: Float, y: Float): Int?

Get the document position for on-screen coordinates. Returns null when outside the editor.