New option: g:signify_difftool

Some VCS rely on an external diff tool, because they don't support the
-U0 flag natively. Most of the time that's the standard 'diff' utility.

But fritzophrenic was reporting that even a GNU diff won't always be
installed as 'diff', but e.g. as 'gnudiff' instead.

You can set the external diff tool now.

Closes #29.
This commit is contained in:
Marco Hinz 2013-06-07 01:01:30 +02:00
parent 068c0e894d
commit e1cbc2082e
2 changed files with 26 additions and 10 deletions

View File

@ -238,6 +238,16 @@ thus not every 'updatetime' miliseconds.
NOTE: This also saves the buffer to disk!
============-
let g:signify_difftool = 'gnudiff'
This will avoid the attempt to find the proper diff tool for version control
systems that rely on an external diff tool that supports the -U0 flag. These
are: svn, bzr, darcs, fossil.
Otherwise 'diff' will be used.
==============================================================================
4. Commands *signify-commands*

View File

@ -30,18 +30,24 @@ let s:sign_delete_first_line = get(g:, 'signify_sign_delete_first_line', '‾')
let s:sign_change = get(g:, 'signify_sign_change', '!')
let s:sign_change_delete = get(g:, 'signify_sign_change_delete', '!_')
if has('win32')
if $VIMRUNTIME =~ ' '
let s:difftool = (&sh =~ '\<cmd') ? ('"'. $VIMRUNTIME .'\diff"') : (substitute($VIMRUNTIME, ' ', '" ', '') .'\diff"')
else
let s:difftool = $VIMRUNTIME .'\diff'
endif
if get(g:, 'signify_difftool')
let s:difftool = g:signify_difftool
else
if !executable('diff')
echomsg 'signify: No diff tool found!'
finish
if has('win32')
if $VIMRUNTIME =~ ' '
let s:difftool = (&sh =~ '\<cmd')
\ ? ('"'. $VIMRUNTIME .'\diff"')
\ : (substitute($VIMRUNTIME, ' ', '" ', '') .'\diff"')
else
let s:difftool = $VIMRUNTIME .'\diff'
endif
else
if !executable('diff')
echomsg 'signify: No diff tool found!'
finish
endif
let s:difftool = 'diff'
endif
let s:difftool = 'diff'
endif
sign define SignifyPlaceholder text=. texthl=SignifyChange linehl=NONE