I'd like the ability to toggle code coverage on and off. I've tried the following but unable to make this work:
autocmd FileType typescriptreact noremap <leader>gc :call ToggleCoverage()<return>
function! ToggleCoverage() abort
if g:coverage_enabled
let g:coverage_enabled = 0
let g:coverage_show_covered = 0
let g:coverage_show_uncovered = 0
else
let g:coverage_enabled = 1
let g:coverage_show_covered = 1
let g:coverage_show_uncovered = 1
endif
call coverage#start()
endfunction
let g:coverage_json_report_path = 'coverage/coverage-final.json'
let g:coverage_enabled = 0
let g:coverage_show_covered = 0
let g:coverage_show_uncovered = 0
I thought maybe :Coverage would do the toggle but it only starts it but doesn't stop it.
Any help would be appreciated. Hopefully this isn't a feature request.
I'd like the ability to toggle code coverage on and off. I've tried the following but unable to make this work:
I thought maybe
:Coveragewould do the toggle but it only starts it but doesn't stop it.Any help would be appreciated. Hopefully this isn't a feature request.