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

View File

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