diff --git a/autoload/sy/debug.vim b/autoload/sy/debug.vim index 32b2640..3443d8d 100644 --- a/autoload/sy/debug.vim +++ b/autoload/sy/debug.vim @@ -46,3 +46,29 @@ function! sy#debug#list_active_buffers() abort endif endfor endfunction + +" Function #verbose_diff_cmd {{{1 +function! sy#debug#verbose_diff_cmd() abort + if exists('b:sy_info') + echohl Statement + echo 'Command: '. b:sy_info.cmd + echohl NONE + let output = sy#repo#get_diff_{b:sy.type}()[1] + if empty(output) + echo 'Output: []' + else + echo 'Output:' + for line in split(output, '\n') + if line[0] == '+' + echohl DiffAdd + elseif line[0] == '-' + echohl DiffDelete + else + echohl NONE + endif + echo line + echohl NONE + endfor + endif + endif +endfunction diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index d5f7495..c31d1ec 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -94,11 +94,13 @@ function! sy#repo#get_stats() abort return b:sy.stats endfunction + " Function: s:run {{{1 function! s:run(cmd, path, do_switch_dir) abort let cmd = substitute(a:cmd, '%f', a:path, '') let cmd = substitute(cmd, '%d', s:difftool, '') let cmd = substitute(cmd, '%n', s:devnull, '') + let b:sy_info.cmd = cmd if a:do_switch_dir try diff --git a/plugin/signify.vim b/plugin/signify.vim index 382e4ea..8fd6cc2 100644 --- a/plugin/signify.vim +++ b/plugin/signify.vim @@ -39,6 +39,7 @@ augroup END " Init: commands {{{1 command! -nargs=0 -bar SignifyDebug call sy#debug#list_active_buffers() +command! -nargs=0 -bar SignifyDebugDiff call sy#debug#verbose_diff_cmd() command! -nargs=0 -bar SignifyRefresh call sy#util#refresh_windows() command! -nargs=0 -bar SignifyToggle call sy#toggle() command! -nargs=0 -bar SignifyToggleHighlight call sy#highlight#line_toggle()