When collapsing equations for Live Preview, leave cursor at the same position relative to the screen

When one edits the LaTeX source of long equations, and then moves the cursor a way, the LaTeX source code of the equation gets replace by a live-preview rendered equation, which usually occupies much less space. This results in the view focus jumping, sometimes far from the current cursor is.

I think the view should be anchored to where the cursor is relative to the current view. This means that the cursor should not change position in the screen when the live-preview rendered equation appears.

To clarify, usually the cursor stays at the correct position in the screen. When this fails, is when I click away from an equation. I made a short recording. Notice how when I click away from the equation, the new cursor position is not constant in the screen. Rather, the cursor jumps (significantly) up.

Screen Recording 2023-09-01 at 14.12.25