diff --git a/after/syntax/tex.vim b/after/syntax/tex.vim index 43564d8..7ccd070 100644 --- a/after/syntax/tex.vim +++ b/after/syntax/tex.vim @@ -14,7 +14,8 @@ endif " {{{1 Add conceal for \emph if has('conceal') && get(g:, 'tex_conceal', 'b') =~# 'b' syntax region texItalStyle - \ matchgroup=texTypeStyle start="\\emph\s*{" end="}" concealends + \ matchgroup=texTypeStyle start="\\emph\s*{" end="}" + \ concealends contains=@texItalGroup endif " }}}1 diff --git a/autoload/vimtex/change.vim b/autoload/vimtex/change.vim index d653584..1508d9e 100644 --- a/autoload/vimtex/change.vim +++ b/autoload/vimtex/change.vim @@ -66,8 +66,18 @@ function! vimtex#change#get_command(...) " {{{1 let l:char = l:line[l:position[1]-1] " Lists of relevant syntax regions - let l:commands = ['texStatement', 'texTypeSize', 'texTypeStyle', 'texBeginEnd'] - let l:argument = ['texMatcher', 'texRefZone', 'texBeginEndName'] + let l:commands = [ + \ 'texStatement', + \ 'texTypeSize', + \ 'texTypeStyle', + \ 'texBeginEnd', + \ ] + let l:argument = [ + \ 'texMatcher', + \ 'texItalStyle', + \ 'texRefZone', + \ 'texBeginEndName', + \ ] for l:syntax in reverse(map(call('synstack', l:position), \ 'synIDattr(v:val, ''name'')')) diff --git a/test/issue-272/main.tex b/test/issue-272/main.tex index 59f1988..3a91e7d 100644 --- a/test/issue-272/main.tex +++ b/test/issue-272/main.tex @@ -1,4 +1,4 @@ \documentclass{minimal} \begin{document} -\emph{$a+1$} +\emph{Italized text and $a+1$.} \end{document}