Environment completion: don't use virtual cursor position
What we actually need here is the real cursor position (where tab is counted as one character) rather than the virtual cursor position (where tab can count as multiple characters depending on the user's config). This commit makes sure that \end{env} is inserted in the right place even when the user uses tabs for indentation.
BUG: 322654
Edited by Kishore Gopalakrishnan