Skip to content

Commit

Permalink
fix: clear buffers from tracking
Browse files Browse the repository at this point in the history
See #109
  • Loading branch information
rcarriga committed Mar 19, 2022
1 parent 5b3d26c commit 2a35653
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Rónán Carrigan
Copyright (c) 2022 Rónán Carrigan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
15 changes: 15 additions & 0 deletions autoload/ultest/process.vim
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
let g:ultest#active_processors = []
let g:ultest_buffers = []

for processor in g:ultest#processors
if get(processor, "condition", 1)
call insert(g:ultest#active_processors, processor)
endif
endfor

augroup UltestBufferTracking
au!
au BufDelete * call <SID>ClearBuffer(expand("<afile>"))
augroup END

function s:ClearBuffer(buf_name) abort
let path = fnamemodify(a:buf_name, ":p")
let buf_index = index(g:ultest_buffers, path)
if buf_index != -1
call remove(g:ultest_buffers, buf_index)
endif
call ultest#summary#render()
endfunction

function ultest#process#new(test) abort
call ultest#process#pre(a:test)
if index(g:ultest_buffers, a:test.file) == -1
Expand Down

0 comments on commit 2a35653

Please sign in to comment.