# Problems with unloaded doc contents and third party integrations.

**URL:** https://discuss.codemirror.net/t/problems-with-unloaded-doc-contents-and-third-party-integrations/3848
**Category:** v6
**Created:** [December 28, 2021, 5:24pm UTC](https://discuss.codemirror.net/t/problems-with-unloaded-doc-contents-and-third-party-integrations/3848 "2021-12-28T17:24:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Roberto](https://discuss.codemirror.net/letter_avatar_proxy/v4/letter/r/8baadc/32.png) [@Roberto](https://discuss.codemirror.net/u/Roberto)
#### Post date: [December 28, 2021, 5:24pm UTC](https://discuss.codemirror.net/t/problems-with-unloaded-doc-contents-and-third-party-integrations/3848/1 "2021-12-28T17:24:17Z")

</div>

This is a pretty meta…ish problem and really not important nor urgent. However, I wanted to talk about it.

AFAIK, CM unloads invisible parts of longer texts inside the editor to save resources. This may — as you’re surely aware of — lead to difficulties with third party features which rely on the entire content being there inside the DOM.

The most simple example is the built-in Cmd+F search of every browser. It doesn’t work for longer texts in CM. A workaround for this is using CM’s own search module.

Another example: I use LT ([https://languagetool.org](https://languagetool.org)) as a browser extension for spell checking. This also breaks in longer (partly unloaded) texts. Whenever LT tries to replace a typo, my document gets mixed up. I think this has something to do with LT not setting the correct indexes of characters within the text, because parts of it have been unloaded in the meantime.

I could probably work around these issues by increasing the buffer size of CM. Is this possible? But I’m wondering if there are better solutions.

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)
#### Post date: [December 29, 2021, 9:58am UTC](https://discuss.codemirror.net/t/problems-with-unloaded-doc-contents-and-third-party-integrations/3848/2 "2021-12-29T09:58:21Z")

</div>

See my reply to [this thread](https://discuss.codemirror.net/t/viewport-issues-with-cm-6/3586). This is a trade-off in the editor’s design, and not something that can reasonably be turned off without introducing performance problems. You’ll have to live with it if you’re using the library.

---

<div class="post-metadata">

### Author: ![Roberto](https://discuss.codemirror.net/letter_avatar_proxy/v4/letter/r/8baadc/32.png) [@Roberto](https://discuss.codemirror.net/u/Roberto)
#### Post date: [December 29, 2021, 1:44pm UTC](https://discuss.codemirror.net/t/problems-with-unloaded-doc-contents-and-third-party-integrations/3848/3 "2021-12-29T13:44:34Z")

</div>

I was expecting this. Thanks for clarifying.

The performance of CM6 is stunning. So it’s easy to accept the trade-off.
