I'm looking for a way to precisely set the cursor position given a virtual column.
Is there only
:exe "normal! ".vcol."|"?
NB: I need virtual columns as they're the only thing that I'm able to compute correctly in a context where there are multi-byte characters that occupy only one column, and tab characters that spawns over several columns.
Regarding the context, I should be more explicit. If I'm looking for a function, it's partly out of curiosity, partly to avoid translating a tuple of coordinates (that I already have thanks to
getpos(a_mark)) into something else, partly for style consistency: I'm trying to fix/enhance a plugin where I try to use functions. This implies I cannot expect something as the virtual editing mode to be in a state or in another: plugins need to work whatever the end-user choose for her/his vim options. Yet, it's true I could change it momentarily and restore it in a
Also, I'm not in the general case where I may end up in the middle of a tabulation. Any position, I want to jump to, is accessible without
'virtualedit' being set. The (computed) position matches a placeholder in an expanded and re-indented code snippet.