From 2c997ed781499e7c1d86bae60657ef7d1270bf5b Mon Sep 17 00:00:00 2001 From: Camille Dejoye Date: Tue, 17 Nov 2020 13:48:57 +0100 Subject: [PATCH 1/2] Fix PHP smart brace hook for static method --- autoload/argwrap/hooks/filetype/php/200_smart_brace.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim b/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim index 0a2db46..c2f08ce 100644 --- a/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim +++ b/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim @@ -3,7 +3,7 @@ function! s:dealWithMethodArguments(container) abort " {{{ return 0 endif - if a:container.prefix !~? '\v^%(public|protected|private)\s+function\s+\S+\s*\($' + if a:container.prefix !~? '\v^%(public|protected|private)(\s+static)?\s+function\s+\S+\s*\($' return 0 endif From 8585d3f2562b8ae2262320efaaa28850898d9fa4 Mon Sep 17 00:00:00 2001 From: Camille Dejoye Date: Sat, 21 Nov 2020 10:25:27 +0100 Subject: [PATCH 2/2] remove remaining spaces at the end of the line after unwrapping --- autoload/argwrap/hooks/filetype/php/200_smart_brace.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim b/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim index c2f08ce..4d32477 100644 --- a/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim +++ b/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim @@ -36,18 +36,18 @@ function! s:fixMethodOpeningBraceAfterUnwrap(range, container, arguments) abort return endif - execute printf("undojoin | normal! %dG$F{i\", a:range.lineStart) + execute printf("undojoin | normal! %dG$F{gelct{\", a:range.lineStart) endfunction " }}} function! argwrap#hooks#filetype#php#200_smart_brace#pre_wrap(range, container, arguments) abort " {{{ " Do nothing but prevent the file to be loaded more than once - " When calling an autoload function that is not define the script that + " When calling an autoload function that is not define, the script that " should contain it is sourced every time the function is called endfunction " }}} function! argwrap#hooks#filetype#php#200_smart_brace#pre_unwrap(range, container, arguments) abort " {{{ " Do nothing but prevent the file to be loaded more than once - " When calling an autoload function that is not define the script that + " When calling an autoload function that is not define, the script that " should contain it is sourced every time the function is called endfunction " }}}