Hi, Have a question about the solution suggested for the issue: browser search in code mirror searches the content visible in view port only. I referred to the link for the same: https://github.com/codemirror/CodeMirror/issues/221 and the page suggests setting the property ‘viewportMargin’ to infinity, however that will lead to performance issue. The same page also suggests the solution in https://codemirror.net/2/demo/search.html. I looked into this demo code and I have the below questions:
- I dont see the property ‘viewportMargin’ set in the demo code, however on inspecting in dev tools, i see that dom nodes are generated for the entire code editor content upfront, probably why the browser search finds all occurrences of the search string throughout the content. - How does this work if the ‘viewportMargin’ property is not set in the code? Is this demo using any other solution to get this working?
- Also I see that the search/searchcursor/dialog js/css files referenced in this demo code is from lib/util, while I can only find the same files inside the addon folder on my codemirror download (I have checked in code mirror version 5.49.2 and the latest version) - Can you please clarify if the specific search related js/css files referenced by the demo should be used for the solution to work? if yes, from where to obtain the files? I tried copy, pasting the content of the files from the demo code, however the solution doesnt seem to work since not all dom nodes are generated upfront in my case.