summaryrefslogtreecommitdiff
path: root/autoload/deoplete/handler.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/deoplete/handler.vim')
-rw-r--r--autoload/deoplete/handler.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/autoload/deoplete/handler.vim b/autoload/deoplete/handler.vim
index b0aa031..2e3a052 100644
--- a/autoload/deoplete/handler.vim
+++ b/autoload/deoplete/handler.vim
@@ -23,8 +23,6 @@ function! deoplete#handler#_init() abort
if g:deoplete#enable_refresh_always
autocmd deoplete InsertCharPre * call s:completion_begin('InsertCharPre')
endif
-
- call s:on_event('Init')
endfunction
function! s:do_complete(timer) abort
@@ -114,6 +112,10 @@ function! s:completion_async(timer) abort
endfunction
function! s:completion_begin(event) abort
+ if !exists('g:deoplete#_initialized')
+ return
+ endif
+
let context = deoplete#init#_context(a:event, [])
if s:is_skip(a:event, context)
call deoplete#mapping#_restore_completeopt()
@@ -189,6 +191,10 @@ function! s:is_skip_text(event) abort
endfunction
function! s:on_event(event) abort
+ if !exists('g:deoplete#_initialized')
+ return
+ endif
+
let context = deoplete#init#_context(a:event, [])
call rpcnotify(g:deoplete#_channel_id, 'deoplete_on_event', context)
endfunction