Re: Restoring the vertical position

Jean Lalonde <[email protected]> Mon, 17 Mar 2025 09:06:38 -0700 (PDT)
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
I forgot to mention that I also tried

intFisrtVisibleLine := SCI_GETFIRSTVISIBLELINE()
...
SCI_  SETFIRSTVISIBLELINE(intFisrtVisibleLine)

But this does not restore the expected position. FYI, SCI_SETWRAPMODE() is 
enabled.

Le lundi 17 mars 2025 à 11 h 54 min 47 s UTC-4, Jean Lalonde a écrit :

> 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/9bbbca85-5a3d-4a08-9ac5-c1003648f477n%40googlegroups.com.