Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TeXmacs/progs/math/math-edit.scm
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ list | boolean
(let ((lb (cadr body))
(rb (caddr body)))
`(symbol-completion
,(string-append lb rb)))))
,lb))))
;; 预留位置:可以在此添加其他函数的处理逻辑

(else #f)))))))))))
Expand Down
32 changes: 32 additions & 0 deletions devel/201_90.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# [201_90] Fix Inner Product symbol display in Tab cycling popup

### What
The `math-bracket-open` case in `lambda-to-symbol` was concatenating the left and right bracket symbols (e.g., `"<langle><rangle>"`). This produced a compound string that the `widget-box` rendering engine (using the `roman` font) could not render correctly, showing as a red broken symbol or `--`. Changed the logic to return only the left bracket symbol (`lb`), which renders correctly as a single TeXmacs symbol (e.g., `⟨`).

### Why
When cycling through math variants for the `<` key (which includes the inner product `⟨⟩` as the 7th variant), the popup window showed a broken/red symbol instead of the angle brackets. This made it difficult for users to identify the inner product variant in the Tab cycling menu.

### How
In `TeXmacs/progs/math/math-edit.scm`:

Modified `lambda-to-symbol` to return only the left bracket symbol for `math-bracket-open`:

```diff
((math-bracket-open)
(and (>= (length (cdr body)) 2)
(string? (cadr body))
(string? (caddr body))
(let ((lb (cadr body))
(rb (caddr body)))
`(symbol-completion
- ,(string-append lb rb)))))
+ ,lb))))
```

### How to test
1. Open Mogan Editor
2. Enter math mode by pressing `$`
3. Type `<`
4. Press `Tab` repeatedly (7 times) to reach the inner product `⟨⟩` variant
5. Verify that the popup window shows the left angle bracket `⟨` clearly (instead of a broken red symbol or `--`)
6. Press `Tab` once more to return to `<` and verify the cycle continues correctly