From e5809849e4f41ee3ea2bd587493145358c4fc186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Wed, 21 Feb 2024 23:21:58 +0100 Subject: [PATCH] fix(syntax): allow new superscript conceals in guard refer: #2886 --- autoload/vimtex/syntax/core.vim | 14 +++++++++----- test/test-syntax/test-conceal.tex | 13 +++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/autoload/vimtex/syntax/core.vim b/autoload/vimtex/syntax/core.vim index 99b9d7b204..0764599211 100644 --- a/autoload/vimtex/syntax/core.vim +++ b/autoload/vimtex/syntax/core.vim @@ -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\>', 'ᵪ'], \ ['(', '₍'], \ [')', '₎'], diff --git a/test/test-syntax/test-conceal.tex b/test/test-syntax/test-conceal.tex index 1923d55f0e..b46fe0405b 100644 --- a/test/test-syntax/test-conceal.tex +++ b/test/test-syntax/test-conceal.tex @@ -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^-$