Promote the use of User events instead of g:goyo_callbacks

This does not break backward compatibility, g:goyo_callbacks is still
allowed.
This commit is contained in:
Junegunn Choi
2014-08-11 02:16:31 +09:00
parent da67185e4a
commit 9e04ccdb9d
2 changed files with 13 additions and 9 deletions

View File

@@ -224,6 +224,7 @@ function! s:goyo_on(width)
if exists('g:goyo_callbacks[0]')
call g:goyo_callbacks[0]()
endif
silent! doautocmd User GoyoEnter
endfunction
function! s:goyo_off()
@@ -312,6 +313,7 @@ function! s:goyo_off()
if exists('g:goyo_callbacks[1]')
call g:goyo_callbacks[1]()
endif
silent! doautocmd User GoyoLeave
endfunction
function! s:goyo(bang, ...)