1
Fork 0

fix: php smart brace with return type hint

This commit is contained in:
Camille Dejoye 2020-06-07 17:00:00 +02:00
parent 0fc75c596c
commit 12ea40a812
1 changed files with 2 additions and 5 deletions

View File

@ -35,14 +35,11 @@ function! s:fixMethodOpeningBraceAfterUnwrap(range, container, arguments) abort
return
endif
if a:container.suffix !~ '\v^\)\s*\{'
if a:container.suffix !~ '\v^\).*\{\s*$'
return
endif
" +1 to get the position after the closing parenthesis
let l:col = stridx(getline(a:range.lineStart), a:container.suffix) + 1
execute printf("undojoin | normal! %dG0%dlct{\<CR>", a:range.lineStart, l:col)
execute printf("undojoin | normal! %dG$F{i\<CR>", a:range.lineStart)
endfunction " }}}
function! argwrap#hooks#filetype#php#200_smart_brace#pre_wrap(range, container, arguments) abort " {{{