Skip to content

Commit

Permalink
[71_36] focus tag first letter doesn't need to be upper case
Browse files Browse the repository at this point in the history
## What
On the focus toolbar, both `bmatrix` and `Bmatrix` is displayed as
`Bmatrix`.

This pull request fix the bug.

It was ported from branch-1.1, the original author is @Yufeng-shen 

## Why
Fix ambiguity.

## How to test your changes?
```
xmake r generic-test
```

---------

Co-authored-by: Yufeng Shen <fyshen13@gmail.com>
  • Loading branch information
da-liii and Yufeng-shen authored Mar 27, 2024
1 parent 5cd1071 commit b634c5f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion TeXmacs/progs/generic/generic-menu.scm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
(focus-tag-name (string->symbol ns)))
(if (symbol-unnumbered? l)
(focus-tag-name (symbol-drop-right l 1))
(with r (upcase-first (tree-name (tree l)))
(with r (tree-name (tree l))
(string-replace r "-" " "))))))

(tm-menu (focus-variant-menu t)
Expand Down
32 changes: 32 additions & 0 deletions TeXmacs/progs/generic/generic-test.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; MODULE : generic-test.scm
;; DESCRIPTION : Test suite for generic
;; COPYRIGHT : (C) 2022 Yufeng Shen
;;
;; This software falls under the GNU general public license version 3 or later.
;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(texmacs-module (generic generic-test)
(:use (generic generic-menu) ))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; generic menu functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define (regtest-focus-tag-name)
(regression-test-group
"focus-tag-name" "string"
focus-tag-name :none
(test "bmatrix" 'bmatrix "bmatrix")
(test "Bmatrix" 'Bmatrix "Bmatrix")
))

(tm-define (regtest-generic)
(let ((n (+ (regtest-focus-tag-name)
)))
(display* "Total: " (object->string n) " tests.\n")
(display "Test suite of generic: ok\n")))

0 comments on commit b634c5f

Please sign in to comment.