I’m trying to scroll the editor to given line numbers, however it sometimes fail to scroll. So I’m wondering
if that’s because of the lazy loading? If the target is too far away from screen, that’s not loaded yet, so lineAt gets nothing and it fails to scroll to.
There is no lazy loading of content text. However, there’s lazy rendering, and depending on the method you’re using to scroll (which you for some reason didn’t explain), that may interfere. Dispatch a transaction with an EditorView.scrollIntoView effect to get reliable scrolling. Use state.doc.line(N).from to find the start position of a given line by number.