From baa6467bc6e8bbec0b566fc6a1e9dcdd59fcd5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Wed, 4 Jan 2017 12:37:36 +0100 Subject: [PATCH] Fixed #649: Silly regex bug --- after/syntax/tex.vim | 4 ++-- test/features/syntax/test-syntax.tex | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/after/syntax/tex.vim b/after/syntax/tex.vim index 973c3ae..79499a6 100644 --- a/after/syntax/tex.vim +++ b/after/syntax/tex.vim @@ -81,7 +81,7 @@ if get(g:, 'tex_fast', 'r') =~# 'r' \ '[Ppf]?[Nn]otecite', \] execute 'syntax match texStatement' - \ '/\v\\' . s:pattern . '\ze\s*\{/' + \ '/\v\\' . s:pattern . '\ze\s*%(\[|\{)/' \ 'nextgroup=texRefOption,texCite' endfor @@ -97,7 +97,7 @@ if get(g:, 'tex_fast', 'r') =~# 'r' \ 'cite%(field|list|name)', \] execute 'syntax match texStatement' - \ '/\v\\' . s:pattern . '\ze\s*\{/' + \ '/\v\\' . s:pattern . '\ze\s*%(\[|\{)/' \ 'nextgroup=texRefOptions,texCites' endfor diff --git a/test/features/syntax/test-syntax.tex b/test/features/syntax/test-syntax.tex index 144365f..f1a8767 100644 --- a/test/features/syntax/test-syntax.tex +++ b/test/features/syntax/test-syntax.tex @@ -90,6 +90,8 @@ const double pi = 3.1415926535 % Cite commands \cite{} \citet*{} +\citep{bibtexkey1} +\citep[e.g.][]{bibtexkey2} \citealt{} \citealt*{} \citealp{}