From 65e2b0ae8513f67624f724e76e53ac7e3cc8fcb5 Mon Sep 17 00:00:00 2001 From: Justin Charette Date: Wed, 8 Jan 2014 23:15:33 -0500 Subject: [PATCH 1/2] Stop phpDocParam highlight leakage Problem: The new Java-like syntax highligting added phpDocComment, et al. However phpDocParams highlighted indented html tags in a file with no doc comments. Fix: Mark phpDocParams as contained, so phpDocParams must reside in phpDocComments to receive vim highlights. Signed-off-by: Justin Charette --- syntax/php.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/php.vim b/syntax/php.vim index 7e9f7d0..3147e0e 100644 --- a/syntax/php.vim +++ b/syntax/php.vim @@ -420,7 +420,7 @@ if !exists("php_ignore_phpdoc") syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpComment syn match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|todo\|tutorial\|uses\|var\|version\)\s\+\S\+.*" contains=phpDocParam containedin=phpComment - syn match phpDocParam "\s\S\+" contains=phpDocIdentifier + syn match phpDocParam "\s\S\+" contained contains=phpDocIdentifier syn match phpDocIdentifier contained "$\h\w*" syn match phpDocTags "@filesource" containedin=phpComment From 22c7308fdbf2d41f51fa3d3268dc3b3ee6f8fb7c Mon Sep 17 00:00:00 2001 From: Stan Angeloff Date: Mon, 13 Jan 2014 16:38:15 +0200 Subject: [PATCH 2/2] Restore spell-checking in docblock comments. --- syntax/php.template | 4 ++-- syntax/php.vim | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/syntax/php.template b/syntax/php.template index 78828fa..e46b286 100644 --- a/syntax/php.template +++ b/syntax/php.template @@ -212,8 +212,8 @@ syn match phpCommentStar contained "^\s*\*$" if !exists("php_ignore_phpdoc") syn case ignore - syn region phpDocComment start="/\*\*" end="\*/" keepend contains=phpCommentTitle,phpDocTags,phpTodo - syn region phpCommentTitle contained matchgroup=phpDocComment start="/\*\*" matchgroup=phpCommmentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=phpCommentStar,phpTodo,phpDocTags containedin=phpComment + syn region phpDocComment start="/\*\*" end="\*/" keepend contains=phpCommentTitle,phpDocTags,phpTodo,@Spell + syn region phpCommentTitle contained matchgroup=phpDocComment start="/\*\*" matchgroup=phpCommmentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=phpCommentStar,phpTodo,phpDocTags,@Spell containedin=phpComment syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpComment syn match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|todo\|tutorial\|uses\|var\|version\)\s\+\S\+.*" contains=phpDocParam containedin=phpComment diff --git a/syntax/php.vim b/syntax/php.vim index 3147e0e..221002a 100644 --- a/syntax/php.vim +++ b/syntax/php.vim @@ -415,8 +415,8 @@ syn match phpCommentStar contained "^\s*\*$" if !exists("php_ignore_phpdoc") syn case ignore - syn region phpDocComment start="/\*\*" end="\*/" keepend contains=phpCommentTitle,phpDocTags,phpTodo - syn region phpCommentTitle contained matchgroup=phpDocComment start="/\*\*" matchgroup=phpCommmentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=phpCommentStar,phpTodo,phpDocTags containedin=phpComment + syn region phpDocComment start="/\*\*" end="\*/" keepend contains=phpCommentTitle,phpDocTags,phpTodo,@Spell + syn region phpCommentTitle contained matchgroup=phpDocComment start="/\*\*" matchgroup=phpCommmentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=phpCommentStar,phpTodo,phpDocTags,@Spell containedin=phpComment syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpComment syn match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|todo\|tutorial\|uses\|var\|version\)\s\+\S\+.*" contains=phpDocParam containedin=phpComment