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
tabedit %
diffthis
let [cwd, chdir] = sy#util#chdir()
try
execute chdir fnameescape(b:sy_info.dir)
leftabove vnew
silent put =system(cmd)
finally
execute chdir fnameescape(cwd)
endtry
silent 1delete
diffthis
set buftype=nofile bufhidden=wipe nomodified