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
1 changed files with 1 additions and 1 deletions

View File

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