TODO seen here: https://gerrit.wikimedia.org/r/#/c/406416/1/modules/ve-mw/ui/ve.ui.MWWikitextSurface.js
We have methods on the surface for converting between source and nwe offsets so should be a case of re-implementing the method form jquery.textSelection.