From b344cfa968e4ee9328c79650bed12ca5afda606e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Sat, 14 Jan 2017 22:14:26 +0100 Subject: [PATCH] Fixed #660: Error in luacode nested syntax --- after/syntax/tex.vim | 12 ++++++------ test/features/syntax/test-syntax.tex | 12 ++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/after/syntax/tex.vim b/after/syntax/tex.vim index 79499a6..1472265 100644 --- a/after/syntax/tex.vim +++ b/after/syntax/tex.vim @@ -175,12 +175,12 @@ syntax region texZone \ keepend \ transparent \ contains=texBeginEnd,@LUA -syntax region texZone - \ start='\\\(directlua\|luadirect\){'rs=s - \ end='}'re=e - \ keepend - \ transparent - \ contains=texBeginEnd,@LUA +syntax match texStatement '\\\(directlua\|luadirect\)' nextgroup=texZoneLua +syntax region texZoneLua matchgroup=Delimiter + \ start='{' + \ end='}' + \ contained + \ contains=@LUA let b:current_syntax = 'tex' " }}}1 diff --git a/test/features/syntax/test-syntax.tex b/test/features/syntax/test-syntax.tex index f1a8767..917e643 100644 --- a/test/features/syntax/test-syntax.tex +++ b/test/features/syntax/test-syntax.tex @@ -104,6 +104,18 @@ const double pi = 3.1415926535 \citeyearpar{} \bibentry{} +\directlua{ + if pdf.getminorversion() \string~= 7 then + print "pfd version 1.7" + end +} + +\begin{luacode} + if pdf.getminorversion() \string~= 7 then + print "pfd version 1.7" + end +\end{luacode} + \end{document} % vim: fdl=9