@monaco-neovim-wasm/lib 0.1.27 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -841,8 +841,8 @@ class le {
841
841
  if (!i) return { kind: "noop" };
842
842
  const s = this.init.ensureActiveState();
843
843
  if (!s || s.model !== i) return { kind: "noop" };
844
- if (!s.shadowLines) {
845
- s.pendingFullSync = !0, s.pendingCursorSync = !0;
844
+ if (!s.shadowLines || s.pendingFullSync) {
845
+ s.pendingFullSync = !0, s.pendingCursorSync = !0, s.pendingBufEdits = [];
846
846
  try {
847
847
  s.shadowLines = i.getLinesContent();
848
848
  } catch {
@@ -851,7 +851,7 @@ class le {
851
851
  return this.scheduleFlushPendingMonacoSync(), { kind: "delegatedInsertPatched", resetDotRepeat: !0, resetReplayPossible: !0 };
852
852
  }
853
853
  if (!e.changes || e.changes.length !== 1) {
854
- s.pendingFullSync = !0, s.pendingCursorSync = !0;
854
+ s.pendingFullSync = !0, s.pendingCursorSync = !0, s.pendingBufEdits = [];
855
855
  try {
856
856
  s.shadowLines = i.getLinesContent();
857
857
  } catch {
@@ -879,7 +879,15 @@ class le {
879
879
  scheduleCursorSyncToNvim() {
880
880
  if (!this.init.isDelegateInsertToMonaco() || this.init.isExitingInsertMode()) return;
881
881
  const e = this.init.getActiveState();
882
- e && (e.pendingCursorSync = !0, this.scheduleFlushPendingMonacoSync());
882
+ if (e) {
883
+ e.pendingCursorSync = !0, e.pendingFullSync = !0;
884
+ try {
885
+ e.shadowLines = e.model.getLinesContent();
886
+ } catch {
887
+ e.shadowLines = null;
888
+ }
889
+ this.scheduleFlushPendingMonacoSync();
890
+ }
883
891
  }
884
892
  scheduleFlushPendingMonacoSync() {
885
893
  if (this.flushTimer) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monaco-neovim-wasm/lib",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Core library for running Neovim (WASM) behind Monaco via msgpack-RPC.",