diff --git a/.changeset/short-tigers-itch.md b/.changeset/short-tigers-itch.md
new file mode 100644
index 00000000..d44bff8d
--- /dev/null
+++ b/.changeset/short-tigers-itch.md
@@ -0,0 +1,5 @@
+---
+'@srcbook/web': patch
+---
+
+Fix undo/redo history affecting multiple files after switching in codeMirror
diff --git a/packages/web/src/components/apps/editor.tsx b/packages/web/src/components/apps/editor.tsx
index 1dd5ad0e..bf77eeef 100644
--- a/packages/web/src/components/apps/editor.tsx
+++ b/packages/web/src/components/apps/editor.tsx
@@ -25,7 +25,13 @@ export function CodeEditor({
const extensions = languageExtension ? [languageExtension] : [];
return (
-
+
);
}