4646if g: vim_php_refactoring_use_default_mapping == 1
4747 nnoremap <unique> <Leader> rlv :call PhpRenameLocalVariable()<CR>
4848 nnoremap <unique> <Leader> rcv :call PhpRenameClassVariable()<CR>
49- nnoremap <unique> <Leader> rm :call PhpRenameMethod()<CR>
5049 nnoremap <unique> <Leader> eu :call PhpExtractUse()<CR>
50+ nnoremap <unique> <Leader> rm :call PhpRenameMethod()<CR>
5151 vnoremap <unique> <Leader> ec :call PhpExtractConst()<CR>
5252 nnoremap <unique> <Leader> ep :call PhpExtractClassProperty()<CR>
5353 vnoremap <unique> <Leader> em :call PhpExtractMethod()<CR>
@@ -147,7 +147,7 @@ endfunction
147147" }}}
148148
149149function ! PhpRenameClassVariable () " {{{
150- let l: oldName = expand (' <cword>' )
150+ let l: oldName = substitute ( expand (' <cword>' ), ' ^\$* ' , ' ' , ' ' )
151151 let l: newName = inputdialog (' Rename ' . l: oldName . ' to: ' )
152152 if s: PhpSearchInCurrentClass (' \%(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<=' . l: newName . ' \>' , ' n' ) > 0
153153 if g: vim_php_refactoring_auto_validate_rename == 0
@@ -162,7 +162,7 @@ endfunction
162162" }}}
163163
164164function ! PhpRenameMethod () " {{{
165- let l: oldName = expand (' <cword>' )
165+ let l: oldName = substitute ( expand (' <cword>' ), ' ^\$* ' , ' ' , ' ' )
166166 let l: newName = inputdialog (' Rename ' . l: oldName . ' to: ' )
167167 if s: PhpSearchInCurrentClass (' \%(\%(' . s: php_regex_func_line . ' \)\|$this->\)\@<=' . l: newName . ' \>' , ' n' ) > 0
168168 if g: vim_php_refactoring_auto_validate_rename == 0
@@ -211,7 +211,7 @@ endfunction
211211
212212function ! PhpExtractClassProperty () " {{{
213213 normal mr
214- let l: name = expand (' <cword>' )
214+ let l: name = substitute ( expand (' <cword>' ), ' ^\$* ' , ' ' , ' ' )
215215 call s: PhpReplaceInCurrentFunction (' $' . l: name . ' \>' , ' $this->' . l: name )
216216 if g: vim_php_refactoring_auto_validate_visibility == 0
217217 let l: visibility = inputdialog (" Visibility (default is " . g: vim_php_refactoring_default_property_visibility . " ): " )
0 commit comments