Restoring the vertical position

Jean Lalonde <[email protected]> Mon, 17 Mar 2025 08:54:47 -0700 (PDT)
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Hi,

I need to capture the current vertical position of the caret (or selection 
start) in the editor in order to restore this position after a complete 
replacement of the editor content with SCI_SETTEXT(). Using SCI_SETSEL() to 
restore the previous position in the document works. But I can't find how 
to restore the previous vertical position.

The expected result is that after replacing the content, the user find the 
caret at the same vertical position it was before the replacement. The 
replaced text has the same number of lines and lines length as the original 
text.

I tried various methods under the "Scrolling and automatic scrolling" 
section of the doc, including SCI_SETYCARETPOLICY(), but none gives the 
expected result.

Thanks for your help.

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/55726da4-cd89-469d-ab65-b6389302e5e9n%40googlegroups.com.