소스 검색

Expand argument to plug#begin (#82)

Junegunn Choi 11 년 전
부모
커밋
a64b156682
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      plug.vim
  2. 5 0
      test/workflow.vader

+ 1 - 1
plug.vim

@@ -84,7 +84,7 @@ let s:loaded = get(s:, 'loaded', {})
 
 function! plug#begin(...)
   if a:0 > 0
-    let home = s:path(fnamemodify(a:1, ':p'))
+    let home = s:path(fnamemodify(expand(a:1), ':p'))
   elseif exists('g:plug_home')
     let home = s:path(g:plug_home)
   elseif !empty(&rtp)

+ 5 - 0
test/workflow.vader

@@ -937,6 +937,11 @@ Execute (Update plugins with U key in visual mode):
   AssertExpect! '[==]', 1
   q
 
+Execute (plug#begin should expand env vars):
+  AssertNotEqual '$HOME/.emacs/plugged', expand('$HOME/.emacs/plugged')
+  call plug#begin('$HOME/.emacs/plugged')
+  AssertEqual expand('$HOME/.emacs/plugged'), g:plug_home
+
 Execute (Cleanup):
   silent! call system('rm -rf '.temp_plugged)
   silent! call rename('fzf', 'fzf-staged')