Skip to content

Commit 435c0e0

Browse files
committed
s:PhpGetFQCNUnderCursor should stop the extraction at the cursor
1 parent 257c78a commit 435c0e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugin/php-refactoring-toolbox.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ let s:php_regex_func_line = '^\s*\%(\%(private\|protected\|public\|static\|abs
8787
let s:php_regex_local_var = '\$\<\%(this\>\)\@![A-Za-z0-9]*'
8888
let s:php_regex_assignment = '+=\|-=\|*=\|/=\|=\~\|!=\|='
8989
let s:php_regex_fqcn = '[\\_A-Za-z0-9]*'
90-
let s:php_regex_cn = '[_A-Za-z0-9]\+$'
90+
let s:php_regex_cn = '[_A-Za-z0-9]\+'
9191
" }}}
9292

9393
function! PhpDocAll() " {{{
@@ -453,12 +453,12 @@ function! s:PhpGetFQCNUnderCursor() " {{{
453453
let l:line = getbufline("%", line('.'))[0]
454454
let l:lineStart = strpart(l:line, 0, col('.'))
455455
let l:lineEnd = strpart(l:line, col('.'), strlen(l:line) - col('.'))
456-
return matchstr(l:lineStart, s:php_regex_fqcn . '$') . matchstr(l:lineEnd, '^' . s:php_regex_fqcn)
456+
return matchstr(l:lineStart, s:php_regex_fqcn . '$') . matchstr(l:lineEnd, '^' . s:php_regex_cn)
457457
endfunction
458458
" }}}
459459

460460
function! s:PhpGetShortClassName(fqcn) " {{{
461-
return matchstr(a:fqcn, s:php_regex_cn)
461+
return matchstr(a:fqcn, s:php_regex_cn . '$')
462462
endfunction
463463
" }}}
464464

0 commit comments

Comments
 (0)