• posToRowCol ?-w win? ?-v? pos
Convert from absolute position to row and column values. It raises an error
if the pos argument is out of range. The values are returned as a
two-element list corresponding to the row and column indices respectively.
Note that row numbers are 1-based and column numbers are 0-based.
The -v option is used to calculate virtual column values
taking into account the size of the tabulations. For instance, if a line
starts with a tabulation followed by a letter A, the A is
at actual position (column) 1 in the row but at virtual position 4 if the
tabulation size for the window is set to 4.
Examples:
String | True col | Virtual col |
tab| | 1 | 4 |
A+tab| | 2 | 4 |
AB+tab| | 3 | 4 |
ABC+tab| | 4 | 4 |
ABCD+tab| | 5 | 8 |
This table indicates the true and virtual positions of the vertical bar
assuming the string is at the beginning of a line and tabSize=4.