Skip to content

Commit 549c7ff

Browse files
committed
Local variable are now global in ComposerKnowWhereCurrentFileIs
with this update, developers can call ComposerKnowWhereCurrentFileIs and use new global variables to their own purposes. For example, call CtrlP with g:currentWord or other behaviors.
1 parent a1bc756 commit 549c7ff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugin/vim-composer.vim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ function! s:ComposerInstallFunc(arg)
5555
endif
5656
endfunction
5757

58-
function! ComposerKnowWhereCurrentFileIs()
59-
let l:currentWord = expand('<cword>')
60-
let l:command = "grep " . l:currentWord . " ./vendor/composer -R | awk '{print $6}' | awk -F\\' '{print $2}'"
58+
function! g:ComposerKnowWhereCurrentFileIs()
59+
let g:currentWord = expand('<cword>')
60+
let l:command = "grep " . g:currentWord . " ./vendor/composer -R | awk '{print $6}' | awk -F\\' '{print $2}'"
6161
let l:commandFileFound = l:command . ' | wc -l'
62-
let l:numberOfResults = system(l:commandFileFound)
63-
if l:numberOfResults == 1
62+
let g:numberOfResults = system(l:commandFileFound)
63+
if g:numberOfResults == 1
6464
let l:fileName = system(l:command)
6565
let l:openFileCommand = 'tabe .' . l:fileName
6666
exec l:openFileCommand

0 commit comments

Comments
 (0)