Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Commit f1c1d2b

Browse files
authored
Merge pull request #27 from camilledejoye/fix/php-smart-brace-handle-static-methods
Fix PHP smart brace hook for static method
2 parents 8f963a1 + 8585d3f commit f1c1d2b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

autoload/argwrap/hooks/filetype/php/200_smart_brace.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function! s:dealWithMethodArguments(container) abort " {{{
33
return 0
44
endif
55

6-
if a:container.prefix !~? '\v^%(public|protected|private)\s+function\s+\S+\s*\($'
6+
if a:container.prefix !~? '\v^%(public|protected|private)(\s+static)?\s+function\s+\S+\s*\($'
77
return 0
88
endif
99

@@ -36,18 +36,18 @@ function! s:fixMethodOpeningBraceAfterUnwrap(range, container, arguments) abort
3636
return
3737
endif
3838

39-
execute printf("undojoin | normal! %dG$F{i\<CR>", a:range.lineStart)
39+
execute printf("undojoin | normal! %dG$F{gelct{\<CR>", a:range.lineStart)
4040
endfunction " }}}
4141

4242
function! argwrap#hooks#filetype#php#200_smart_brace#pre_wrap(range, container, arguments) abort " {{{
4343
" Do nothing but prevent the file to be loaded more than once
44-
" When calling an autoload function that is not define the script that
44+
" When calling an autoload function that is not define, the script that
4545
" should contain it is sourced every time the function is called
4646
endfunction " }}}
4747

4848
function! argwrap#hooks#filetype#php#200_smart_brace#pre_unwrap(range, container, arguments) abort " {{{
4949
" Do nothing but prevent the file to be loaded more than once
50-
" When calling an autoload function that is not define the script that
50+
" When calling an autoload function that is not define, the script that
5151
" should contain it is sourced every time the function is called
5252
endfunction " }}}
5353

0 commit comments

Comments
 (0)