Commits

Meikel Brandmeyer committed 1b07ab2

Invalidate ResultBuffer if necessary

Fixes #61

Comments (0)

Files changed (1)

vim/autoload/vimclojure.vim

 	endif
 endfunction
 
+function! s:InvalidateResultBufferIfNecessary(buf)
+	if g:vimclojure#ResultBuffer.__instance != []
+				\ && g:vimclojure#ResultBuffer.__instance[0]._buffer == a:buf
+		let g:vimclojure#ResultBuffer.__instance = []
+	endif
+endfunction
+
+augroup VimClojureResultBuffer
+	" au BufDelete * call s:InvalidateResultBufferIfNecessary(expand("<abuf>"))
+augroup END
+
 " A special result buffer for clojure output.
 let vimclojure#ClojureResultBuffer = copy(vimclojure#ResultBuffer)
 let vimclojure#ClojureResultBuffer["__superResultBufferInit"] =