Skip to content

Commit bb19b44

Browse files
committed
Fix #20 (rlv is case insensitive).
1 parent 5606827 commit bb19b44

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

plugin/php-refactoring-toolbox.vim

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,38 +177,38 @@ endfunction
177177
function! 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)
189189
endfunction
190190
" }}}
191191

192192
function! 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)
204204
endfunction
205205
" }}}
206206

207207
function! 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

Comments
 (0)