SignifyToggleFold -> SignifyFold!

This commit is contained in:
Marco Hinz 2015-12-09 00:31:59 +01:00
parent 75cdb17d99
commit 2dc2526426
2 changed files with 18 additions and 10 deletions

View File

@ -31,6 +31,15 @@ function! SignifyFoldText()
return left . fill . right
endfunction
" Function: #dispatch {{{1
function! sy#fold#dispatch(do_tab) abort
if a:do_tab
call sy#fold#enable(1)
else
call sy#fold#toggle()
endif
endfunction
" Function: #enable {{{1
function! sy#fold#enable(do_tab) abort
if !exists('b:sy')
@ -59,7 +68,7 @@ function! sy#fold#disable() abort
endfunction
" Function: #toggle {{{1
function! sy#fold#toggle(do_tab) abort
function! sy#fold#toggle() abort
if exists('w:sy_folded')
call sy#fold#disable()
if w:sy_folded.method == 'manual'
@ -73,7 +82,7 @@ function! sy#fold#toggle(do_tab) abort
mkview
let &viewoptions = old_vop
endif
call sy#fold#enable(a:do_tab)
call sy#fold#enable(0)
endif
redraw!

View File

@ -38,14 +38,13 @@ 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 SignifyDebugUnknown call sy#repo#debug_detection()
command! -nargs=0 -bar SignifyFold call sy#fold#enable(1)
command! -nargs=0 -bar SignifyRefresh call sy#util#refresh_windows()
command! -nargs=0 -bar SignifyToggle call sy#toggle()
command! -nargs=0 -bar SignifyToggleFold call sy#fold#toggle(0)
command! -nargs=0 -bar SignifyToggleHighlight call sy#highlight#line_toggle()
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 SignifyDebugUnknown call sy#repo#debug_detection()
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 SignifyToggle call sy#toggle()
command! -nargs=0 -bar SignifyToggleHighlight call sy#highlight#line_toggle()
" Init: mappings {{{1