Verbose: mention cmd dir and run dir

This commit is contained in:
Marco Hinz 2018-12-27 15:37:51 +01:00
parent 49c8ce0f13
commit 14f7fda000
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F
2 changed files with 9 additions and 3 deletions

View File

@ -159,8 +159,14 @@ endfunction
" Function: #verbose {{{1 " Function: #verbose {{{1
function! sy#verbose(msg, ...) abort function! sy#verbose(msg, ...) abort
if &verbose if &verbose
if type(a:msg) == type([])
for msg in a:msg
echomsg printf('[sy%s] %s', (a:0 ? ':'.a:1 : ''), msg)
endfor
else
echomsg printf('[sy%s] %s', (a:0 ? ':'.a:1 : ''), a:msg) echomsg printf('[sy%s] %s', (a:0 ? ':'.a:1 : ''), a:msg)
endif endif
endif
endfunction endfunction
" Function: s:skip {{{1 " Function: s:skip {{{1

View File

@ -75,7 +75,7 @@ function! sy#repo#get_diff_start(vcs) abort
let [cmd, options] = s:initialize_job(a:vcs) let [cmd, options] = s:initialize_job(a:vcs)
let [cwd, chdir] = sy#util#chdir() let [cwd, chdir] = sy#util#chdir()
call sy#verbose(printf('CMD: %s | CWD: %s', string(cmd), b:sy.info.dir), a:vcs) call sy#verbose(['CMD: '. string(cmd), 'CMD DIR: '. b:sy.info.dir, 'ORIG DIR: '. cwd], a:vcs)
try try
execute chdir fnameescape(b:sy.info.dir) execute chdir fnameescape(b:sy.info.dir)
@ -100,7 +100,7 @@ function! sy#repo#get_diff_start(vcs) abort
let [cmd, options] = s:initialize_job(a:vcs) let [cmd, options] = s:initialize_job(a:vcs)
let [cwd, chdir] = sy#util#chdir() let [cwd, chdir] = sy#util#chdir()
call sy#verbose(printf('CMD: %s | CWD: %s', string(cmd), getcwd()), a:vcs) call sy#verbose(['CMD: '. string(cmd), 'CMD DIR: '. b:sy.info.dir, 'ORIG DIR: '. cwd], a:vcs)
try try
execute chdir fnameescape(b:sy.info.dir) execute chdir fnameescape(b:sy.info.dir)