File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 94943 . ** 状态判断** :
9595 - ` is_startup_tab_file(file) ` :检查文件路径是否为 ` tmfs://startup-tab `
9696 - ` is_startup_tab_current_view() ` :检查 current view 的 buffer 是否为 startup-tab
97+
98+ ## 2026/04/28 修复 216_1 引入的初始化延后问题
99+
100+ ### 问题描述
101+ 216_1 的更改(启动标签页骨架 + 入口绑定)导致部分初始化流程延后,使得 ` src/Data/Tree/tree_traverse.cpp ` 中 ` init_sections() ` 函数内的以下两行 Scheme 调用运行时机异常:
102+ ``` cpp
103+ eval ("(use-modules (text text-drd))");
104+ object l = eval("(append (section-tag-list) (section* -tag-list))");
105+ ```
106+ 由于初始化延后,`section-tag-list` 和 `section*-tag-list` 返回的结果中可能包含 `UNKNOWN` 标签。若直接将 `UNKNOWN` 插入 `section_tags`,会导致后续遍历或查找章节标签时出现未定义行为。
107+
108+ ### 修复方案
109+ 在 `init_sections()` 的循环中增加 `UNKNOWN` 检查,过滤掉无效标签:
110+ ```cpp
111+ tree_label tl = as_tree_label(as_symbol(car(l)));
112+ if (tl != UNKNOWN) {
113+ section_tags->insert(tl);
114+ }
115+ ```
116+ 相关修复提交见 ` src/Data/Tree/tree_traverse.cpp ` 。
Original file line number Diff line number Diff line change @@ -776,7 +776,10 @@ init_sections () {
776776 eval (" (use-modules (text text-drd))" );
777777 object l= eval (" (append (section-tag-list) (section*-tag-list))" );
778778 while (!is_null (l)) {
779- section_tags->insert (as_tree_label (as_symbol (car (l))));
779+ tree_label tl= as_tree_label (as_symbol (car (l)));
780+ if (tl != UNKNOWN) {
781+ section_tags->insert (tl);
782+ }
780783 l= cdr (l);
781784 }
782785 }
You can’t perform that action at this time.
0 commit comments