diff --git a/TeXmacs/progs/math/math-edit.scm b/TeXmacs/progs/math/math-edit.scm index 8115f6dbe4..660c4214e1 100644 --- a/TeXmacs/progs/math/math-edit.scm +++ b/TeXmacs/progs/math/math-edit.scm @@ -833,7 +833,7 @@ list | boolean (let ((lb (cadr body)) (rb (caddr body))) `(symbol-completion - ,(string-append lb rb))))) + ,lb)))) ;; 预留位置:可以在此添加其他函数的处理逻辑 (else #f))))))))))) diff --git a/devel/201_90.md b/devel/201_90.md new file mode 100644 index 0000000000..b66c2961a9 --- /dev/null +++ b/devel/201_90.md @@ -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., `""`). 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