Skip to content

How to get the Line Length of a given TEditor / TFileEditor Textline based on cursor.y ? #152

Answered by magiblot
paule32 asked this question in Q&A
Discussion options

You must be logged in to vote

You may use the lineStart, lineEnd and charPos methods. For example:

uint currentLineLengthInBytes = lineEnd(curPtr) - lineStart(curPtr);
uint currentLineWidth = charPos(lineStart(curPtr), lineEnd(curPtr));

uint lengthInBytesFromCurrentPositionUntilEol = lineEnd(curPtr) - curPtr;
uint widthFromCurrentPositionUntilEol = charPos(curPtr, lineEnd(curPtr));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by paule32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants