Skip to content

Commit

Permalink
Add :Signify{En,Dis}ableAll
Browse files Browse the repository at this point in the history
  • Loading branch information
mhinz committed Nov 20, 2019
1 parent 4b041ce commit f5a6fcb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions autoload/sy.vim
Expand Up @@ -80,6 +80,22 @@ function! sy#toggle() abort
call call(empty(getbufvar(bufnr(''), 'sy')) ? 'sy#start' : 'sy#stop', [])
endfunction

" #start_all {{{1
function! sy#start_all() abort
for bufnr in range(1, bufnr(''))
call sy#start({'bufnr': bufnr})
endfor
endfunction

" #stop_all {{{1
function! sy#stop_all() abort
for bufnr in range(1, bufnr(''))
if !empty(getbufvar(bufnr, 'sy'))
call sy#stop(bufnr)
endif
endfor
endfunction

" #buffer_is_active {{{1
function! sy#buffer_is_active()
return !empty(getbufvar(bufnr(''), 'sy'))
Expand Down
3 changes: 3 additions & 0 deletions plugin/signify.vim
Expand Up @@ -17,10 +17,13 @@ command! -nargs=0 -bar -bang SignifyDiff call sy#repo#diffmode(<bang>
command! -nargs=0 -bar SignifyHunkDiff call sy#repo#diff_hunk()
command! -nargs=0 -bar SignifyHunkUndo call sy#repo#undo_hunk()
command! -nargs=0 -bar SignifyRefresh call sy#util#refresh_windows()

command! -nargs=0 -bar SignifyEnable call sy#start()
command! -nargs=0 -bar SignifyDisable call sy#stop()
command! -nargs=0 -bar SignifyToggle call sy#toggle()
command! -nargs=0 -bar SignifyToggleHighlight call sy#highlight#line_toggle()
command! -nargs=0 -bar SignifyEnableAll call sy#start_all()
command! -nargs=0 -bar SignifyDisableAll call sy#stop_all()

" Mappings {{{1
let s:cpoptions = &cpoptions
Expand Down

0 comments on commit f5a6fcb

Please sign in to comment.