Skip to content

Commit

Permalink
SignifyDiff! will not open a new tab
Browse files Browse the repository at this point in the history
This makes is behave like :SignifyFold.

Closes #271
  • Loading branch information
mhinz committed Nov 2, 2018
1 parent cd8a852 commit c4eb6e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions autoload/sy/repo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion doc/signify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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|.

------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion plugin/signify.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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(<bang>1)
command! -nargs=0 -bar SignifyDiff call sy#repo#diffmode()
command! -nargs=0 -bar -bang SignifyDiff call sy#repo#diffmode(<bang>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()
Expand Down

0 comments on commit c4eb6e1

Please sign in to comment.