title: `onDidChangeTextDocument` not triggering after `applyEdit`
body: <p>I am creating a VS Code extension for editing text files, and based my project off the <a href="https://code.visualstudio.com/api/extension-guides/custom-editors" rel="nofollow noreferrer">docs</a> and <a href="https://github.com/microsoft/vscode-extension-samples/tree/main/custom-editor-sample" rel="nofollow noreferrer">Cat Customs example</a>.</p>
  <p>I currently have a <a href="https://github.com/adamerose/markdown-editor" rel="nofollow noreferrer">minimal working example</a> that uses a <code>contenteditable</code> div as a text editor to edit *.txt files. Similar to the Cat Customs sample, I use a <code>CustomTextEditorProvider</code> that connects to a Webview containing the editor, and use <code>postMessage</code> to update the document when the Webview text is changed, and then refresh the Webview to match the document if the document is saved. I am also logging occurrences of <code>onDidChangeTextDocument</code> which demonstrates my problem...</p>
  <p>My problem is that if I type characters in the editor very quickly, my Webview sends a <code>postMessage</code> for every character and each triggers a corresponding <code>applyEdit</code> call, but many of these <code>applyEdit</code> calls don't seem to actually update the document model. I see the <code>onDidChangeTextDocument</code> event doesn't occur for many of them, and when I hit Ctrl+S to save my document it is missing updates from the latest <code>applyEdit</code> calls.</p>
  <p>These are the two files that define everything I described above:<br />
  <code>CustomTextEditorProvider </code>: <a href="https://github.com/adamerose/markdown-editor/blob/master/src/textEditor.ts" rel="nofollow noreferrer">https://github.com/adamerose/markdown-editor/blob/master/src/textEditor.ts</a><br />
  <code>Webview</code>: <a href="https://github.com/adamerose/markdown-editor/blob/master/media/textEditorInitScript.js" rel="nofollow noreferrer">https://github.com/adamerose/markdown-editor/blob/master/media/textEditorInitScript.js</a></p>
  <p>Video example: <a href="https://www.screencast.com/t/tDa1XtqoUAyj" rel="nofollow noreferrer">https://www.screencast.com/t/tDa1XtqoUAyj</a><br />
  <em>I type <code>asdf</code> slowly and it works fine, then I type <code>4321</code> very quickly and the last 2 characters don't trigger <code>onDidChangeTextDocument</code> so when I save it reverts to <code>43</code></em></p>
  <p>Here are some related issues but still couldn't solve my problem after reading them:</p>
  <ul>
  <li><p><a href="https://github.com/microsoft/vscode/issues/111331" rel="nofollow noreferrer">https://github.com/microsoft/vscode/issues/111331</a></p>
  </li>
  <li><p><a href="https://github.com/microsoft/vscode/issues/48908" rel="nofollow noreferrer">https://github.com/microsoft/vscode/issues/48908</a></p>
  </li>
  </ul>