Skip to content

Commit

Permalink
Check correct executable if g:signify_vcs_cmds was set
Browse files Browse the repository at this point in the history
References #327
  • Loading branch information
mhinz committed Dec 6, 2019
1 parent ec57a86 commit 27a5141
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions autoload/sy/repo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -606,37 +606,6 @@ endfunction
" 1}}}

" Variables {{{1
let s:difftool = get(g:, 'signify_difftool', 'diff')
if executable(s:difftool)
let s:vcs_dict = {
\ 'git': 'git',
\ 'yadm': 'yadm',
\ 'hg': 'hg',
\ 'svn': 'svn',
\ 'darcs': 'darcs',
\ 'bzr': 'bzr',
\ 'fossil': 'fossil',
\ 'cvs': 'cvs',
\ 'rcs': 'rcsdiff',
\ 'accurev': 'accurev',
\ 'perforce': 'p4',
\ 'tfs': 'tf'
\ }
else
call sy#verbose('No "diff" executable found. Disable support for svn, darcs, bzr.')
let s:vcs_dict = {
\ 'git': 'git',
\ 'yadm': 'yadm',
\ 'hg': 'hg',
\ 'fossil': 'fossil',
\ 'cvs': 'cvs',
\ 'rcs': 'rcsdiff',
\ 'accurev': 'accurev',
\ 'perforce': 'p4',
\ 'tfs': 'tf'
\ }
endif

let s:default_vcs_cmds = {
\ 'git': 'git diff --no-color --no-ext-diff -U0 -- %f',
\ 'yadm': 'yadm diff --no-color --no-ext-diff -U0 -- %f',
Expand Down Expand Up @@ -678,6 +647,8 @@ else
let g:signify_vcs_cmds_diffmode = s:default_vcs_cmds_diffmode
endif

let s:vcs_dict = map(copy(g:signify_vcs_cmds), 'split(v:val)[0]')

if exists('g:signify_skip') && has_key(g:signify_skip, 'vcs')
if has_key(g:signify_skip.vcs, 'allow')
let s:vcs_list = filter(copy(g:signify_skip.vcs.allow), 'executable(s:vcs_dict[v:val])')
Expand All @@ -691,5 +662,5 @@ else
let s:vcs_list = keys(filter(s:vcs_dict, 'executable(v:val)'))
endif

let s:difftool = sy#util#escape(s:difftool)
let s:difftool = sy#util#escape(get(g:, 'signify_difftool', 'diff'))
let s:devnull = has('win32') || has ('win64') ? 'NUL' : '/dev/null'

0 comments on commit 27a5141

Please sign in to comment.