Closed RyotaUshio closed 7 months ago
One obvious solution would be holding a state field representing the position of theorem callouts at each moment. (The index data cannot be used because it might be outdated by 2 sec)
Another solution is counting auto-numbered theorem callouts outside (or more specifically, before) the viewport from the index. While the viewport can change rapidly, the position of theorem callouts located before the viewport can be expected not to change, maybe?
This approach is not acceptable since it is possible that exactly the same document is opened in two different panes and one adds a theorem far outside the viewport of the other.
(it's ok if we can tolerate a small lag < 2 sec)
This is because CodeMirror doesn't render elements outside the viewport. They're not just not updated, they do not exist in the first place.