Keep track of opened documents and prepare for undo/redo

This commit is contained in:
Misode
2024-10-22 15:43:02 +02:00
parent 9cb7f7297c
commit ea37eb168f
6 changed files with 68 additions and 30 deletions

View File

@@ -78,7 +78,7 @@ export function SourcePanel({ spyglass, docAndNode, doCopy, doDownload, doImport
if (!spyglass || !docAndNode) return
try {
const data = await parseSource(value, format)
await spyglass.setFileContents(version, docAndNode.doc.uri, JSON.stringify(data))
await spyglass.writeFile(version, docAndNode.doc.uri, JSON.stringify(data))
} catch (e) {
if (e instanceof Error) {
e.message = `Error importing: ${e.message}`