Method XbpMLE():lineFromChar() Foundation

Calculates the row number based on the character position in the edit buffer.

Syntax
:lineFromChar( [<nPos>] ) --> nLine
Parameters
<nPos>
<nPos> is a numeric value specifying the position of a character in the edit buffer. The row number where this character would appear in the edit window is returned. If <nPos> is not specified, this method returns the row number where the cursor is currently found.
Return

This method returns a numeric value indicating the row number where the character at the position <nPos> would be displayed.

Description

The method :lineFromChar() calculates the row number based on the position of an individual character within the edit buffer. In order to determine the current row number (the row where the cursor is currently found) the method is called without specifying a parameter.

The counterpart of :lineFromChar() is the method :charFromLine(). :charFromLine() calculates the start position of a row in the edit buffer based on the row number.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.