[0603] 修复边注直接编辑交互#3326
Merged
Merged
Conversation
参考 comments 插件模式,将 marginal-note 的 accessible 属性从 none 改为 2, 使 body 可直接编辑;同时去掉 make-marginal-note 中的 inactive 包裹, 插入后不再显示 <marginal-note|...> 源代码形式。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4d9047f to
83b0364
Compare
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
如何测试
修改内容
问题描述
此前插入边注时,由于
marginal-note的 DRD 属性为accessible|none,且make-marginal-note显式包裹了inactive,导致:<marginal-note|normal|c|正文>此外,边注渲染后鼠标无法点击进入编辑,只能用方向键移入。
修复方案
参考 comments 插件的实现模式(
unfolded-comment的 DRD 设为accessible|6,插入时不包裹inactive):修改 DRD:将
marginal-note的accessible属性从none改为2,使第三个参数(body)可直接编辑TeXmacs/packages/standard/std-markup.ts修改插入命令:去掉
inactive包裹,光标路径从(0 2 0)改为(2 0)TeXmacs/progs/generic/generic-edit.scm修复鼠标点击进入边注:
lazy_paragraph.cpp在排版line-note时将其包装为resize_box(..., 0, 0, 0, 0),导致边界框为空,phrase_box的鼠标点击测试无法命中边注区域。改为使用move_box的实际边界,使鼠标可以直接点击进入边注 body。src/Typeset/Line/lazy_paragraph.cpp