diff --git a/ftplugin/gitcommit.vim b/ftplugin/gitcommit.vim index b0f19bf..bfc5b33 100644 --- a/ftplugin/gitcommit.vim +++ b/ftplugin/gitcommit.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: git config file " Maintainer: Tim Pope -" Last Change: 2008 Mar 09 +" Last Change: 2008 Jun 04 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) @@ -54,12 +54,12 @@ function! s:gitdiffcached(bang,gitdir,...) let git .= " --git-dir=".(exists("*shellescape") ? shellescape(a:gitdir) : '"'.a:gitdir.'"') endif if a:0 - let extra = join(map(copy(a:000),has("*shellescape") ? 'shellescape(v:val)' : "'\"'.v:val.'\"'")) + let extra = join(map(copy(a:000),exists("*shellescape") ? 'shellescape(v:val)' : "'\"'.v:val.'\"'")) else let extra = "-p --stat=".&columns endif - call system(git." diff --cached --no-color ".extra." > ".name) - exe "pedit ".name + call system(git." diff --cached --no-color ".extra." > ".(exists("*shellescape") ? shellescape(name) : name)) + exe "pedit ".(exists("*fnameescape") ? fnameescape(name) : name) wincmd P let b:git_dir = a:gitdir command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(0,b:git_dir,)