The API to call is view.rowcol
.
To use it on a region in a selection, assume you have a region r
.
You can use
startrow, startcol = view.rowcol(r.a)
endrow, endcol = view.rowcol(r.b)
{
'start': {'line': startrow, 'col': startcol},
'end': {'line': endrow, 'col': endcol}
}
Note that "start" and "end" have a variety of meanings with regards to selections. You might for instance want to replace r.a, r.b
with r.begin(), r.end()
.