From 397f3342dc4082b9bd1512c011e46048f9c5d816 Mon Sep 17 00:00:00 2001 From: blu3gui7ar Date: Thu, 15 May 2014 18:28:36 +0800 Subject: [PATCH 1/2] fix: error matching 'function' in function names such as 'register_shutdown_function'. --- plugin/phpfolding.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/phpfolding.vim b/plugin/phpfolding.vim index a44fba8..4f4e9d4 100644 --- a/plugin/phpfolding.vim +++ b/plugin/phpfolding.vim @@ -176,7 +176,7 @@ function! s:PHPCustomFolds() " {{{ " 'g:searchEmptyLinesPostfixing'.. " Fold function with PhpDoc (function foo() {}) - call s:PHPFoldPureBlock('function', s:FOLD_WITH_PHPDOC) + call s:PHPFoldPureBlock('function\s', s:FOLD_WITH_PHPDOC) " Fold class properties with PhpDoc (var $foo = NULL;) call s:PHPFoldProperties('^\s*\(\(private\)\|\(public\)\|\(protected\)\|\(var\)\)\s\$', ";", s:FOLD_WITH_PHPDOC, 1, 1) From 05d1b92101500889d4b06b5eb08f4a51a1fc3cf8 Mon Sep 17 00:00:00 2001 From: blu3gui7ar Date: Thu, 15 May 2014 18:59:30 +0800 Subject: [PATCH 2/2] Pass some more test cases. --- plugin/phpfolding.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/phpfolding.vim b/plugin/phpfolding.vim index 4f4e9d4..4b390d2 100644 --- a/plugin/phpfolding.vim +++ b/plugin/phpfolding.vim @@ -176,7 +176,7 @@ function! s:PHPCustomFolds() " {{{ " 'g:searchEmptyLinesPostfixing'.. " Fold function with PhpDoc (function foo() {}) - call s:PHPFoldPureBlock('function\s', s:FOLD_WITH_PHPDOC) + call s:PHPFoldPureBlock('\(^\|\s\)function\s', s:FOLD_WITH_PHPDOC) " Fold class properties with PhpDoc (var $foo = NULL;) call s:PHPFoldProperties('^\s*\(\(private\)\|\(public\)\|\(protected\)\|\(var\)\)\s\$', ";", s:FOLD_WITH_PHPDOC, 1, 1)