Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remembering scroll position when replacing text #6

Open
lennartb- opened this issue Apr 28, 2024 · 0 comments
Open

Remembering scroll position when replacing text #6

lennartb- opened this issue Apr 28, 2024 · 0 comments

Comments

@lennartb-
Copy link

Hi,

I have a small issue I can't seem to solve: I want to preserve the vertical scroll position when replacing text via SetText. Currently, the editor always scrolls to the top. I'm wary of any line- or-caret-based logic for that, since I have word-wrapping active and some of the content I set has some really long lines that wrap multiple times - unless Scintilla can somehow deal with that. I haven't found any matching properties for that anyway.

My initial approach was to get the ScrollBar of the editor via the VisualTree and try to access the position (which works, the Value property seems to contain the position), however setting it has ultimately no effect. I can set the value, but, checking the ValueChanged event, the value gets always overwritten with 0 immediately after (from somewhere within the framework).

Do you have any idea how to achieve that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant