SignifyDiff: cd into dir of file

All VCS assume slightly different things where things have to be if you're in
this directory using that command etc.

Changing to the directory of the current file avoids many pitfalls.
This commit is contained in:
Marco Hinz 2018-04-13 13:01:02 +02:00
parent 14413921fe
commit d9e881bd0f
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

View File

@ -260,8 +260,14 @@ function! sy#repo#diffmode() abort
let ft = &filetype let ft = &filetype
tabedit % tabedit %
diffthis diffthis
leftabove vnew let [cwd, chdir] = sy#util#chdir()
silent put =system(cmd) try
execute chdir fnameescape(b:sy_info.dir)
leftabove vnew
silent put =system(cmd)
finally
execute chdir fnameescape(cwd)
endtry
silent 1delete silent 1delete
diffthis diffthis
set buftype=nofile bufhidden=wipe nomodified set buftype=nofile bufhidden=wipe nomodified