Fixed #669: Better bookkeeping and exit handling

* Don't remove blobs on exit
* Properly reuse existing local blobs
This commit is contained in:
Karl Yngve Lervåg 2017-01-24 21:36:54 +01:00
parent 7c1b6c02e7
commit 2495c848ed

View File

@ -456,6 +456,14 @@ function! s:init_local_blob() " {{{1
let l:filename = expand('%:p') let l:filename = expand('%:p')
if b:vimtex.tex !=# l:filename if b:vimtex.tex !=# l:filename
let l:vimtex_id = s:get_id(l:filename)
if l:vimtex_id >= 0
let b:vimtex_local = {
\ 'active' : 0,
\ 'main_id' : b:vimtex_id,
\ 'sub_id' : l:vimtex_id,
\}
else
let l:local = deepcopy(b:vimtex) let l:local = deepcopy(b:vimtex)
let l:local.tex = l:filename let l:local.tex = l:filename
let l:local.pid = 0 let l:local.pid = 0
@ -472,6 +480,7 @@ function! s:init_local_blob() " {{{1
\ 'sub_id' : s:vimtex_next_id, \ 'sub_id' : s:vimtex_next_id,
\} \}
endif endif
endif
endfunction endfunction
" }}}1 " }}}1
@ -830,7 +839,7 @@ function! s:buffer_deleted(...) " {{{1
" latex project " latex project
" "
if l:count <= 1 if l:count <= 1
let l:vimtex = remove(g:vimtex_data, l:vimtex_id) let l:vimtex = g:vimtex_data[l:vimtex_id]
if exists('#User#VimtexEventQuit') if exists('#User#VimtexEventQuit')
if exists('b:vimtex') if exists('b:vimtex')