Add :SignifyEnable and :SignifyDisable
This commit is contained in:
parent
812b305b79
commit
e134c152e0
@ -110,19 +110,33 @@ function! sy#stop(bufnr) abort
|
|||||||
call sy#sign#remove_all_signs(a:bufnr)
|
call sy#sign#remove_all_signs(a:bufnr)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #toggle {{{1
|
" Function: #enable {{{1
|
||||||
function! sy#toggle() abort
|
function! sy#enable() abort
|
||||||
if !exists('b:sy')
|
if !exists('b:sy')
|
||||||
call sy#start()
|
call sy#start()
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if b:sy.active
|
if !b:sy.active
|
||||||
call sy#stop(b:sy.buffer)
|
|
||||||
let b:sy.active = 0
|
|
||||||
let b:sy.stats = [-1, -1, -1]
|
|
||||||
else
|
|
||||||
let b:sy.active = 1
|
let b:sy.active = 1
|
||||||
call sy#start()
|
call sy#start()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Function: #disable {{{1
|
||||||
|
function! sy#disable() abort
|
||||||
|
if exists('b:sy') && b:sy.active
|
||||||
|
call sy#stop(b:sy.buffer)
|
||||||
|
let b:sy.active = 0
|
||||||
|
let b:sy.stats = [-1, -1, -1]
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Function: #toggle {{{1
|
||||||
|
function! sy#toggle() abort
|
||||||
|
if !exists('b:sy') || !b:sy.active
|
||||||
|
call sy#enable()
|
||||||
|
else
|
||||||
|
call sy#disable()
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
@ -310,6 +310,20 @@ Default: [3, 8]
|
|||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
COMMAND *signify-commands*
|
COMMAND *signify-commands*
|
||||||
|
*signify-:SignifyEnable*
|
||||||
|
>
|
||||||
|
:SignifyEnable
|
||||||
|
<
|
||||||
|
Enable the plugin for the current buffer only.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*signify-:SignifyDisable*
|
||||||
|
>
|
||||||
|
:SignifyDisable
|
||||||
|
<
|
||||||
|
Disable the plugin for the current buffer only.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
*signify-:SignifyToggle*
|
*signify-:SignifyToggle*
|
||||||
>
|
>
|
||||||
:SignifyToggle
|
:SignifyToggle
|
||||||
|
@ -43,6 +43,8 @@ command! -nargs=0 -bar SignifyDebugDiff call sy#debug#verbose_diff_c
|
|||||||
command! -nargs=0 -bar SignifyDebugUnknown call sy#repo#debug_detection()
|
command! -nargs=0 -bar SignifyDebugUnknown call sy#repo#debug_detection()
|
||||||
command! -nargs=0 -bar -bang SignifyFold call sy#fold#dispatch(<bang>1)
|
command! -nargs=0 -bar -bang SignifyFold call sy#fold#dispatch(<bang>1)
|
||||||
command! -nargs=0 -bar SignifyRefresh call sy#util#refresh_windows()
|
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()
|
||||||
command! -nargs=0 -bar SignifyToggle call sy#toggle()
|
command! -nargs=0 -bar SignifyToggle call sy#toggle()
|
||||||
command! -nargs=0 -bar SignifyToggleHighlight call sy#highlight#line_toggle()
|
command! -nargs=0 -bar SignifyToggleHighlight call sy#highlight#line_toggle()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user