The last argument doesn't have to be a path

This commit is contained in:
Junegunn Choi 2013-11-20 10:46:53 +09:00
parent f28274109f
commit 2540c9062f

View File

@ -31,7 +31,7 @@ function! fzf#run(command, ...)
let cwd = getcwd() let cwd = getcwd()
try try
let args = copy(a:000) let args = copy(a:000)
if len(args) > 0 if len(args) > 0 && isdirectory(expand(args[-1]))
let dir = remove(args, -1) let dir = remove(args, -1)
execute 'chdir '.s:escape(dir) execute 'chdir '.s:escape(dir)
endif endif