@@ -177,38 +177,38 @@ endfunction
177177function ! PhpRenameLocalVariable () " {{{
178178 let l: oldName = substitute (expand (' <cword>' ), ' ^\$*' , ' ' , ' ' )
179179 let l: newName = inputdialog (' Rename ' . l: oldName . ' to: ' )
180- if s: PhpSearchInCurrentFunction ( ' $ ' . l: newName . ' \> ' , ' n ' ) > 0
181- if g: vim_php_refactoring_auto_validate_rename == 0
180+ if g: vim_php_refactoring_auto_validate_rename == 0
181+ if s: PhpSearchInCurrentFunction ( ' \C$ ' . l: newName . ' \> ' , ' n ' ) > 0
182182 call s: PhpEchoError (' $' . l: newName . ' seems to already exist in the current function scope. Rename anyway ?' )
183183 if inputlist ([" 0. No" , " 1. Yes" ]) == 0
184184 return
185185 endif
186186 endif
187187 endif
188- call s: PhpReplaceInCurrentFunction (' $' . l: oldName . ' \>' , ' $' . l: newName )
188+ call s: PhpReplaceInCurrentFunction (' \C $' . l: oldName . ' \>' , ' $' . l: newName )
189189endfunction
190190" }}}
191191
192192function ! PhpRenameClassVariable () " {{{
193193 let l: oldName = substitute (expand (' <cword>' ), ' ^\$*' , ' ' , ' ' )
194194 let l: newName = inputdialog (' Rename ' . l: oldName . ' to: ' )
195- if s: PhpSearchInCurrentClass ( ' \%(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<= ' . l: newName . ' \> ' , ' n ' ) > 0
196- if g: vim_php_refactoring_auto_validate_rename == 0
195+ if g: vim_php_refactoring_auto_validate_rename == 0
196+ if s: PhpSearchInCurrentClass ( ' \C\%(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<= ' . l: newName . ' \> ' , ' n ' ) > 0
197197 call s: PhpEchoError (l: newName . ' seems to already exist in the current class. Rename anyway ?' )
198198 if inputlist ([" 0. No" , " 1. Yes" ]) == 0
199199 return
200200 endif
201201 endif
202202 endif
203- call s: PhpReplaceInCurrentClass (' \%(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<=' . l: oldName . ' \>' , l: newName )
203+ call s: PhpReplaceInCurrentClass (' \C\ %(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<=' . l: oldName . ' \>' , l: newName )
204204endfunction
205205" }}}
206206
207207function ! PhpRenameMethod () " {{{
208208 let l: oldName = substitute (expand (' <cword>' ), ' ^\$*' , ' ' , ' ' )
209209 let l: newName = inputdialog (' Rename ' . l: oldName . ' to: ' )
210- if s: PhpSearchInCurrentClass ( ' \%(\%( ' . s: php_regex_func_line . ' \)\|$this->\)\@<= ' . l: newName . ' \> ' , ' n ' ) > 0
211- if g: vim_php_refactoring_auto_validate_rename == 0
210+ if g: vim_php_refactoring_auto_validate_rename == 0
211+ if s: PhpSearchInCurrentClass ( ' \%(\%( ' . s: php_regex_func_line . ' \)\|$this->\)\@<= ' . l: newName . ' \> ' , ' n ' ) > 0
212212 call s: PhpEchoError (l: newName . ' seems to already exist in the current class. Rename anyway ?' )
213213 if inputlist ([" 0. No" , " 1. Yes" ]) == 0
214214 return
0 commit comments