Auto merge of #2979 - micbou:allowed-on-char-events, r=puremourning

[READY] Check if completion is allowed on character events

We should check if completion is allowed when a character is inserted or deleted like we do with the other events.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2979)
<!-- Reviewable:end -->
This commit is contained in:
zzbot 2018-04-14 15:16:56 -07:00 committed by GitHub
commit 3bcc45ead1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -588,12 +588,20 @@ endfunction
function! s:OnInsertChar()
if !s:AllowedToCompleteInCurrentBuffer()
return
endif
call timer_stop( s:pollers.completion.id )
call s:CloseCompletionMenu()
endfunction
function! s:OnDeleteChar( key )
if !s:AllowedToCompleteInCurrentBuffer()
return a:key
endif
call timer_stop( s:pollers.completion.id )
if pumvisible()
return "\<C-y>" . a:key