Merged
Conversation
Contributor
Greptile Summary本 PR 实现了列表的 Shift+Tab 反缩进功能,并对 Tab 缩进功能进行了重构和优化,包括:复用已有子列表、合并跟随子列表、保留精确列表样式变体(如 Confidence Score: 4/5主体逻辑正确,Shift+Tab 反缩进与 Tab 缩进互为逆操作,可以合并;但 enumerate-1~4 的兼容性遗漏建议修复后再合并。 所有剩余问题均为 P2 级别(无 P0/P1),但其中 enumerate-1~4 的标签遗漏会在现实中造成旧文档 Tab 功能静默失效,属于易于修复的向后兼容性回归,建议处理后再合并,故评分 4 而非 5。 TeXmacs/progs/generic/generic-edit.scm — enumerate-tag-list 的兼容性调整和反缩进 trailing sublist 边界情况。 Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["kbd-variant 触发\n(focus-tree = item/item*)"] --> B{forwards?}
B -->|true - Tab 缩进| C{item-index > 0?}
B -->|false - Shift+Tab 反缩进| D{outer-list 存在?}
C -->|No| C1["无操作\n(没有前一个 item)"]
C -->|Yes| E{前一个 item\n已有子列表?}
E -->|Yes| F["复用已有子列表\n(find-following-list-index)"]
E -->|No| G["插入新空子列表"]
F --> H{当前 item 后\n紧跟同类子列表?}
G --> H
H -->|Yes| I["合并跟随子列表内容\n(attached-items)"]
H -->|No| J["仅移动当前 item"]
I --> K["append-strees-to-document\n更新 target-doc"]
J --> K
K --> L["删除旧节点\n(从右往左避免漂移)"]
L --> M["定位光标到 moved-item"]
D -->|No - 已在最外层| D1["无操作\n(阻止继续反缩进)"]
D -->|Yes| N{item 是\n子列表首个?}
N -->|No - Case 1| O["保留原子列表\n移除 item 及后续节点\n插入到 sublist 之后"]
N -->|Yes - Case 2| P["删除原子列表\n插入到原 sublist 位置"]
O --> Q{有后续节点?}
P --> Q
Q -->|Yes| R["重建同类型 trailing sublist"]
Q -->|No| S["定位光标到提升后的 item"]
R --> S
Reviews (2): Last reviewed commit: "resolve comments" | Re-trigger Greptile |
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.
No description provided.