Skip to content

Commit

Permalink
fix(syntax): allow new superscript conceals in guard
Browse files Browse the repository at this point in the history
refer: #2886
  • Loading branch information
lervag committed Feb 21, 2024
1 parent 749317b commit e580984
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
14 changes: 9 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
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 e580984

Please sign in to comment.