From 12ea40a812b081c7da2439b2be3fa28faf8bfb41 Mon Sep 17 00:00:00 2001 From: Camille Dejoye Date: Sun, 7 Jun 2020 17:00:00 +0200 Subject: [PATCH] fix: php smart brace with return type hint --- autoload/argwrap/hooks/filetype/php/200_smart_brace.vim | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim b/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim index 230ecdb..37cc691 100644 --- a/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim +++ b/autoload/argwrap/hooks/filetype/php/200_smart_brace.vim @@ -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{\", a:range.lineStart, l:col) + execute printf("undojoin | normal! %dG$F{i\", a:range.lineStart) endfunction " }}} function! argwrap#hooks#filetype#php#200_smart_brace#pre_wrap(range, container, arguments) abort " {{{