File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 531531
532532 < assign | marginal - note | < macro | hpos | vpos | body | < with | dummy1 | < value | marginal - note - width > | dummy2 | < value | marginal - note - sep > | < compound | < merge | marginal - | < arg | hpos > | - note > | < arg | vpos > | < arg | body > | < arg | hpos > > >>>
533533
534- < drd - props | marginal - note | arity | 3 | accessible | none >
534+ < drd - props | marginal - note | arity | 3 | accessible | 2 >
535535
536536 < \active * >
537537 < \src - comment >
Original file line number Diff line number Diff line change @@ -1643,7 +1643,7 @@ TODO: 在文本模式中,可以自动识别剪贴板中的内容,并智能
16431643(tm-define (make-marginal-note)
16441644 (:synopsis "Insert a marginal note")
16451645 (wrap-selection-small
1646- (insert-go-to `(inactive ( marginal-note "normal" "c" "")) '(0 2 0))))
1646+ (insert-go-to `(marginal-note "normal" "c" "") '(2 0))))
16471647
16481648(tm-define (test-marginal-note-hpos? hp)
16491649 (and-with t (tree-innermost 'marginal-note #t)
Original file line number Diff line number Diff line change 1+ # [ 0603] 修复边注直接编辑交互
2+
3+ ## 如何测试
4+
5+ 1 . 编译并启动 Mogan
6+ 2 . 新建一个文档
7+ 3 . 点击菜单:插入 → 注记 → 边注(或输入 ` \marginal-note ` 后回车)
8+ 4 . ** 预期结果** :不应出现 ` <marginal-note|normal|c|> ` 的源代码形式,而是直接渲染在页面边缘的边注,光标位于边注 body 中,可直接输入文字
9+ 5 . 选中文档中一段文字后,再插入边注,确认选中内容自动进入边注 body
10+ 6 . 点击边注使其获得焦点,确认浮动工具栏中的位置(左/右/自动)和对齐(上/中/下)设置仍可正常使用
11+
12+ ## 修改内容
13+
14+ ### 问题描述
15+
16+ 此前插入边注时,由于 ` marginal-note ` 的 DRD 属性为 ` accessible|none ` ,且 ` make-marginal-note ` 显式包裹了 ` inactive ` ,导致:
17+ - 插入后显示源代码形式 ` <marginal-note|normal|c|正文> `
18+ - 用户需要按 Enter 激活后才能看到渲染效果
19+ - 再次编辑时需要按 Backspace 重新进入 inactive 编辑模式
20+
21+ ### 修复方案
22+
23+ 参考 comments 插件的实现模式(` unfolded-comment ` 的 DRD 设为 ` accessible|6 ` ,插入时不包裹 ` inactive ` ):
24+
25+ 1 . ** 修改 DRD** :将 ` marginal-note ` 的 ` accessible ` 属性从 ` none ` 改为 ` 2 ` ,使第三个参数(body)可直接编辑
26+ - 文件:` TeXmacs/packages/standard/std-markup.ts `
27+
28+ 2 . ** 修改插入命令** :去掉 ` inactive ` 包裹,光标路径从 ` (0 2 0) ` 改为 ` (2 0) `
29+ - 文件:` TeXmacs/progs/generic/generic-edit.scm `
30+
31+ ### 相关文件
32+
33+ - ` TeXmacs/packages/standard/std-markup.ts `
34+ - ` TeXmacs/progs/generic/generic-edit.scm `
You can’t perform that action at this time.
0 commit comments