Skip to content

Commit

Permalink
merge: support more superscripts
Browse files Browse the repository at this point in the history
refer: #2886
  • Loading branch information
lervag committed Feb 21, 2024
2 parents 9df79e1 + e580984 commit f9161b4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
26 changes: 21 additions & 5 deletions autoload/vimtex/syntax/core.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1396,16 +1396,20 @@ endfunction

let s:re_sub =
\ '[-+=()0-9aehijklmnoprstuvx]\|\\\%('
\ . join([
\ 'beta', 'rho', 'phi', 'gamma', 'chi'
\ .. join([
\ 'beta', 'gamma', 'rho', 'phi', 'chi'
\ ], '\|') . '\)\>'
let s:re_super =
\ '[-+=()<>:;0-9a-qr-zA-FG-QRTUVW]\|\\\%('
\ .. join([
\ 'beta', 'gamma', 'delta', 'epsilon', 'theta', 'iota', 'phi', 'chi'
\ ], '\|') . '\)\>'
let s:re_super = '[-+=()<>:;0-9a-pr-zABDEG-PRTUVW]'

let s:map_sub = [
\ ['\\beta\>', ''],
\ ['\\rho\>', ''],
\ ['\\phi\>', ''],
\ ['\\gamma\>', ''],
\ ['\\rho\>', ''],
\ ['\\phi\>', ''],
\ ['\\chi\>', ''],
\ ['(', ''],
\ [')', ''],
Expand Down Expand Up @@ -1442,6 +1446,14 @@ let s:map_sub = [
\]

let s:map_super = [
\ ['\\beta\>', ''],
\ ['\\gamma\>', ''],
\ ['\\delta\>', ''],
\ ['\\epsilon\>', ''],
\ ['\\theta\>', 'ᶿ'],
\ ['\\iota\>', ''],
\ ['\\phi\>', ''],
\ ['\\chi\>', ''],
\ ['(', ''],
\ [')', ''],
\ ['+', ''],
Expand Down Expand Up @@ -1477,6 +1489,7 @@ let s:map_super = [
\ ['n', ''],
\ ['o', ''],
\ ['p', ''],
\ ['q', '𐞥'],
\ ['r', 'ʳ'],
\ ['s', 'ˢ'],
\ ['t', ''],
Expand All @@ -1488,8 +1501,10 @@ let s:map_super = [
\ ['z', ''],
\ ['A', ''],
\ ['B', ''],
\ ['C', ''],
\ ['D', ''],
\ ['E', ''],
\ ['F', ''],
\ ['G', ''],
\ ['H', ''],
\ ['I', ''],
Expand All @@ -1500,6 +1515,7 @@ let s:map_super = [
\ ['N', ''],
\ ['O', ''],
\ ['P', ''],
\ ['Q', ''],
\ ['R', 'ᴿ'],
\ ['T', ''],
\ ['U', ''],
Expand Down
13 changes: 13 additions & 0 deletions test/test-syntax/test-conceal.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@
$a_\rho$
$\ket{\psi_{i+1}}$

$a^q$
$a^C$
$a^F$
$a^Q$
$a^{\beta}$
$a^{\gamma}$
$a^{\delta}$
$a^{\epsilon}$
$a^{\theta}$
$a^{\iota}$
$a^{\phi}$
$a^{\chi}$

$a^1$
$a^+$
$a^-$
Expand Down

0 comments on commit f9161b4

Please sign in to comment.