@@ -157,18 +157,18 @@ function! s:on_text_document_did_open() abort
157157endfunction
158158
159159function ! s: on_text_document_did_save () abort
160- call lsp#log (' s:on_text_document_did_save()' , bufnr (' %' ))
161160 let l: buf = bufnr (' %' )
161+ call lsp#log (' s:on_text_document_did_save()' , l: buf )
162162 for l: server_name in lsp#get_whitelisted_servers ()
163- call s: ensure_flush (bufnr ( ' % ' ) , l: server_name , {result- >s: call_did_save (l: buf , l: server_name , result, function (' s:Noop' ))})
163+ call s: ensure_flush (: buf , l: server_name , {result- >s: call_did_save (l: buf , l: server_name , result, function (' s:Noop' ))})
164164 endfor
165165endfunction
166166
167167function ! s: on_text_document_did_change () abort
168- call lsp#log (' s:on_text_document_did_change()' , bufnr (' %' ))
169168 let l: buf = bufnr (' %' )
169+ call lsp#log (' s:on_text_document_did_change()' , l: buf )
170170 for l: server_name in lsp#get_whitelisted_servers ()
171- call s: ensure_flush (bufnr ( ' % ' ) , l: server_name , function (' s:Noop' ))
171+ call s: ensure_flush (l: buf , l: server_name , function (' s:Noop' ))
172172 endfor
173173endfunction
174174
@@ -214,7 +214,9 @@ function! s:call_did_save(buf, server_name, result, cb) abort
214214endfunction
215215
216216function ! s: on_text_document_did_close () abort
217- call lsp#log (' s:on_text_document_did_close()' , bufnr (' %' ))
217+ let l: buf = bufnr (' %' )
218+ call lsp#log (' s:on_text_document_did_close()' , l: buf )
219+ call remove (s: file_content , l: buf )
218220endfunction
219221
220222function ! s: ensure_flush_all (buf , server_names) abort
0 commit comments