Merge branch 'dev'

This commit is contained in:
Strahinja Val Markovic 2013-08-07 19:07:05 -07:00
commit 88bd375efd

View File

@ -206,6 +206,19 @@ function! s:SetUpCompleteopt()
endif endif
endfunction endfunction
" For various functions/use-cases, we want to keep track of whether the buffer
" has changed since the last time they were invoked. We keep the state of
" b:changedtick of the last time the specific function was called in
" b:ycm_changedtick.
function! s:SetUpYcmChangedTick()
let b:ycm_changedtick =
\ get( b:, 'ycm_changedtick', {
\ 'file_ready_to_parse' : -1,
\ } )
endfunction
function! s:OnVimLeave() function! s:OnVimLeave()
py ycm_state.OnVimLeave() py ycm_state.OnVimLeave()
py extra_conf_store.CallExtraConfVimCloseIfExists() py extra_conf_store.CallExtraConfVimCloseIfExists()
@ -213,6 +226,11 @@ endfunction
function! s:OnBufferVisit() function! s:OnBufferVisit()
" We need to do this even when we are not allowed to complete in the current
" file because we might be allowed to complete in the future! The canonical
" example is creating a new buffer with :enew and then setting a filetype.
call s:SetUpYcmChangedTick()
if !s:AllowedToCompleteInCurrentFile() if !s:AllowedToCompleteInCurrentFile()
return return
endif endif
@ -247,7 +265,11 @@ endfunction
function! s:OnFileReadyToParse() function! s:OnFileReadyToParse()
let buffer_changed = b:changedtick != b:ycm_changedtick.file_ready_to_parse
if buffer_changed
py ycm_state.OnFileReadyToParse() py ycm_state.OnFileReadyToParse()
endif
let b:ycm_changedtick.file_ready_to_parse = b:changedtick
endfunction endfunction