cm.getViewport() returns {from: 0, to: 40}, but I’m unable to find a corresponding setter.
The issue is that users sometimes use the browser’s search function to find text, and if that text is outside of the current viewport it is not present in the DOM and is thus not found. What I’d like to do is add an event handler to Ctrl-F that quickly sets the viewport to its maximum extents, then allows the browser’s search to proceed as expected.
When the user presses Ctrl-F, the editor instantly renders all lines, and the subsequent search work perfectly across the entire document. Likewise for Ctrl-G (repeat search). And Mac support.