diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index d433971..e545b2c 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -26,7 +26,7 @@ endif " Function: #detect {{{1 function! sy#repo#detect(path) abort - for type in get(g:, 'signify_vcs_list', [ 'git', 'hg', 'svn', 'darcs', 'bzr', 'fossil', 'cvs', 'rcs', 'accurev' ]) + for type in get(g:, 'signify_vcs_list', [ 'git', 'hg', 'svn', 'darcs', 'bzr', 'fossil', 'cvs', 'rcs', 'accurev', 'perforce' ]) let diff = sy#repo#get_diff_{type}(a:path) if !empty(diff) return [ diff, type ] @@ -139,6 +139,14 @@ function! sy#repo#get_diff_accurev(path) abort endif endfunction +" Function: #get_diff_perforce {{{1 +function! sy#repo#get_diff_perforce(path) abort + if executable('perforce') + let diff = system('env P4DIFF=diff p4 diff -dU0 -- '. sy#util#escape(a:path)) + return v:shell_error ? '' : diff + endif +endfunction + " Function: #process_diff {{{1 function! sy#repo#process_diff(path, diff) abort " Determine where we have to put our signs.