feat(阅读编辑): 优化大文件阅读编辑、页码显示,修复异常日期
build.yaml / build (push) Successful in 41s

This commit is contained in:
xiaoqidun committed 2026-09-24 00:27:02 +08:00
1 parent e3908c1149
commit 46e6d5b622
9 files changed
+611 -152

No files matched your search

+6 -5
View File
@@ -24,7 +24,8 @@ import (
// 入参: edit 批量修改回调
// 返回: error 修改错误
func (e *Editor) Transaction(edit func(*Editor) error) error {
before := e.transactionSnapshot()
before := *e
before.Info = cloneEditorData(e.Info)
next := e.transactionSnapshot()
next.history, next.historyIndex, next.historyLimit = nil, 0, 0
*e = next
@@ -32,10 +33,10 @@ func (e *Editor) Transaction(edit func(*Editor) error) error {
*e = before
return err
}
next = e.transactionSnapshot()
*e = before
changed := next.revision != before.revision
e.restoreTransaction(next)
changed := e.revision != before.revision
e.history, e.historyIndex, e.historyLimit = before.history, before.historyIndex, before.historyLimit
e.backends, e.fontFS = before.backends, before.fontFS
e.fontRenderer, e.fontMetrics = before.fontRenderer, before.fontMetrics
if changed {
e.serial, e.revision = before.serial, before.revision
if change := e.recordChange(); change != nil {