diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index 7d9e940..c15213d 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -240,7 +240,7 @@ function! sy#repo#debug_detection() endfunction " Function: #diffmode {{{1 -function! sy#repo#diffmode() abort +function! sy#repo#diffmode(do_tab) abort execute sy#util#return_if_no_changes() let vcs = b:sy.updated_by @@ -252,7 +252,9 @@ function! sy#repo#diffmode() abort let cmd = s:expand_cmd(vcs, g:signify_vcs_cmds_diffmode) call sy#verbose('SignifyDiff: '. cmd, vcs) let ft = &filetype - tabedit % + if a:do_tab + tabedit % + endif diffthis let [cwd, chdir] = sy#util#chdir() try diff --git a/doc/signify.txt b/doc/signify.txt index 433d376..3345bb2 100644 --- a/doc/signify.txt +++ b/doc/signify.txt @@ -448,11 +448,13 @@ NOTE: Nothing will happen, if :SignifyRefresh is used from the |cmdline-window|. ------------------------------------------------------------------------------ *signify-:SignifyDiff* > - :SignifyDiff + :SignifyDiff[!] < Open a new tab with two windows using |diff-mode| to show the differences between the current file and its version that was last checked in. +With [!], no new tab will be opened. + Also see |g:signify_vcs_cmds_diffmode|. ------------------------------------------------------------------------------ diff --git a/plugin/signify.vim b/plugin/signify.vim index 73ced3e..3a13442 100644 --- a/plugin/signify.vim +++ b/plugin/signify.vim @@ -66,7 +66,7 @@ augroup END command! -nargs=0 -bar SignifyList call sy#debug#list_active_buffers() command! -nargs=0 -bar SignifyDebug call sy#repo#debug_detection() command! -nargs=0 -bar -bang SignifyFold call sy#fold#dispatch(1) -command! -nargs=0 -bar SignifyDiff call sy#repo#diffmode() +command! -nargs=0 -bar -bang SignifyDiff call sy#repo#diffmode(1) command! -nargs=0 -bar SignifyRefresh call sy#util#refresh_windows() command! -nargs=0 -bar SignifyEnable call sy#enable() command! -nargs=0 -bar SignifyDisable call sy#disable()