Skip to content

Commit

Permalink
fix: simplify syntax regexes
Browse files Browse the repository at this point in the history
refer: #2877
  • Loading branch information
lervag committed Jan 26, 2024
1 parent fe20ab1 commit 3880af6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions autoload/vimtex/syntax/core.vim
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ function! vimtex#syntax#core#init_rules() abort " {{{1

syntax match texLigature "--"
syntax match texLigature "---"
syntax match texLigature "\v%(``|''|,,)"
syntax match texLigature "``\|''\|,,"
syntax match texTabularChar "&"
syntax match texTabularChar "\\\\"

" E.g.: \$ \& \% \# \{ \} \_ \S \P
syntax match texSpecialChar "\%(\\\@<!\)\@<=\~"
syntax match texSpecialChar "\\\@<!\~"
syntax match texSpecialChar "\\ "
syntax match texSpecialChar "\\[$&%#{}_@]"
syntax match texSpecialChar "\\[SP@]\ze[^a-zA-Z@]"
Expand Down Expand Up @@ -559,8 +559,8 @@ function! vimtex#syntax#core#init_rules() abort " {{{1
" Math regions: Inline Math Zones
let l:conceal = g:vimtex_syntax_conceal.math_bounds ? 'concealends' : ''
execute 'syntax region texMathZoneLI matchgroup=texMathDelimZoneLI'
\ 'start="\%(\\\@<!\)\@<=\\("'
\ 'end="\%(\\\@<!\)\@<=\\)"'
\ 'start="\\\@<!\\("'
\ 'end="\\\@<!\\)"'
\ 'contains=@texClusterMath'
\ l:conceal
execute 'syntax region texMathZoneLD matchgroup=texMathDelimZoneLD'
Expand Down Expand Up @@ -2174,7 +2174,7 @@ endfunction

" }}}1
function! s:match_conceal_spacing() abort " {{{1
syntax match texSpecialChar "\%(\\\@<!\)\@<=\~" conceal cchar=
syntax match texSpecialChar "\\\@<!\~" conceal cchar=
syntax match texSpecialChar "\\ " conceal cchar=
syntax match texSpecialChar "\\[,;:!>]" conceal
syntax match texSpecialChar "\\@\ze\s\+" conceal
Expand Down

0 comments on commit 3880af6

Please sign in to comment.