How to get first displayed document line number if line wrapping is enabled?

Viewed 296

I use SCI_GETFIRSTVISIBLELINE of Scintilla in order to get the first displayed line of the document.

Now, I enabled word wrapping mode by setting SCI_SETWRAPMODE to SC_WRAP_WORD. But SCI_GETFIRSTVISIBLELINE does not match the document line any more.

Is there a way to get the first displayed document line (also, how to know if the displayed line is part of a wrapped line)? Scintilla itself knows it, as the correct line number is displayed before the text (when enabling SC_MARGIN_NUMBER).

Update: The first document line of the visible line can be get by calling SCI_DOCLINEFROMVISIBLE with the result of SCI_GETFIRSTVISIBLELINE. However, detecting partial lines is still a problem.

1 Answers
Related