Repository navigation
fix(mac): reduce editor file-open lag - #174
Merged
1lck merged 4 commits intoAug 19, 2026
Merged
Conversation
Owner
|
有冲突麻烦解决下 |
1lck
approved these changes
Aug 19, 2026
This was referenced Nov 22, 2026
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 22, 2026
8 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. 避免 SwiftUI 重复刷新
问题: 编辑器刷新界面时,会同步发布光标、选区和查找状态,再次触发 SwiftUI 刷新。日志中出现的 66 次以下错误与该调用链吻合:
处理:
2. 语法高亮改为按需处理
问题: 原实现显示首屏后,仍会在主线程分块扫描全文,执行多组正则并修改文本样式。文件越大,主线程被持续占用的时间越长。
处理:
3. Java 分析移出主线程
问题: 打开 Java 文件时,需要分析代码折叠区域和实现标记。原流程在主线程执行,而且同一份源码可能被重复解析。
处理:
另外,编辑器初始化时移除了一次不必要的全文装饰刷新,并增加了高亮范围缓存测试。
本轮没有缓存完整编辑器页面,是否需要该能力将在本轮效果实测后决定。缓存全部编辑器页面虽然可能提升标签切回速度,但会增加内存占用和状态管理复杂度。