[0121] 修复绘图区域数学模式中光标左移导致的死循环#3356
Merged
Merged
Conversation
yinyuscloor
approved these changes
May 14, 2026
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.
问题描述
在绘图区域(graphics)的数学模式(math-at)中,按左方向键移动光标时,软件会卡死。
根因分析
[23_21] Ban jump in text/math at of graphics area提交中引入的 lambda:在
math-at内部结构扁平时光标路径只有 3 层,innermost-pattern检查到的t2就是math-at本身,其tree-ref :up为graphics,不等于math-at,导致innermost-pattern永远返回假。同时go-left一直在改变光标位置,使得go-to-next-inside-sub的循环永远无法退出,形成死循环。修复方案
将 lambda 改为向上遍历祖先链:
这样在扁平结构和嵌套结构下都能正确匹配。
修改的文件
TeXmacs/progs/graphics/graphics-kbd.scmdevel/0121.md