fix(回归优化): 修复浏览器回归并优化内存
build.yaml / build (push) Successful in 49s

This commit is contained in:
xiaoqidun committed 2026-10-21 18:28:57 +08:00
1 parent 974b515374
commit 67f4cf9d2c
13 files changed
+401 -44

No files matched your search

+13
View File
@@ -146,6 +146,19 @@ func (e *Editor) Snapshot(ctx context.Context) (*Editor, error) {
}
snapshot.revision, snapshot.serial, snapshot.saveTarget = e.revision, e.serial, e.saveTarget
snapshot.backends, snapshot.fontDirs, snapshot.fontFS = e.backends, slices.Clone(e.fontDirs), slices.Clone(e.fontFS)
for _, resource := range e.resources {
if err := ctx.Err(); err != nil {
return nil, err
}
if resource.font == nil || resource.font.FontFile == "" || !next.fileNames[resource.name] {
continue
}
data, err := next.readFileViewContext(ctx, resource.name)
if err != nil {
return nil, err
}
snapshot.resources = append(snapshot.resources, editorResource{name: resource.name, data: data, font: cloneEditorData(resource.font)})
}
if e.source != nil {
snapshot.source.retiredAttachments = maps.Clone(e.source.retiredAttachments)
snapshot.source.removedAttachments = maps.Clone(e.source.removedAttachments)