From 27a5141541cd312879b414fcdb4c0111b35211aa Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 6 Dec 2019 21:55:58 +0100 Subject: [PATCH] Check correct executable if g:signify_vcs_cmds was set References https://github.com/mhinz/vim-signify/issues/327 --- autoload/sy/repo.vim | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index c83d0c95..5d73dfe4 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -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', @@ -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])') @@ -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'