File data/vim/plugin/uncov.vim changed (mode: 100644) (index cc13316..2638601) |
1 |
1 |
" Vim plugin for querying coverage information from uncov command-line tool. |
" Vim plugin for querying coverage information from uncov command-line tool. |
2 |
2 |
|
|
3 |
3 |
" Maintainer: xaizek <xaizek@openmailbox.org> |
" Maintainer: xaizek <xaizek@openmailbox.org> |
4 |
|
" Last Change: 2017 January 03 |
|
|
4 |
|
" Last Change: 2017 January 08 |
5 |
5 |
" License: Same terms as Vim itself (see `help license`) |
" License: Same terms as Vim itself (see `help license`) |
6 |
6 |
|
|
7 |
7 |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
|
... |
... |
augroup Uncov |
17 |
17 |
\ highlight UncovCovered ctermbg=darkgreen guibg=darkgreen |
\ highlight UncovCovered ctermbg=darkgreen guibg=darkgreen |
18 |
18 |
autocmd ColorScheme * |
autocmd ColorScheme * |
19 |
19 |
\ highlight UncovMissed ctermbg=darkred guibg=darkred |
\ highlight UncovMissed ctermbg=darkred guibg=darkred |
20 |
|
" when closing the buffer, return to original tab |
|
21 |
|
autocmd BufWinLeave * |
|
22 |
|
\ if tabpagewinnr(tabpagenr(), '$') == 1 && |
|
23 |
|
\ getbufvar(expand('<afile>'), 'uncovOriginalTab', -1) > 0 | |
|
24 |
|
\ execute 'normal' getbufvar(expand('<afile>'), |
|
25 |
|
\ 'uncovOriginalTab').'gt' | |
|
26 |
|
\ endif |
|
27 |
20 |
augroup end |
augroup end |
28 |
21 |
doautocmd Uncov ColorScheme |
doautocmd Uncov ColorScheme |
29 |
22 |
|
|
|
... |
... |
function! s:ShowCoverage() abort |
54 |
47 |
|
|
55 |
48 |
let l:cursPos = getcurpos() |
let l:cursPos = getcurpos() |
56 |
49 |
|
|
57 |
|
let l:originalTab = tabpagenr() |
|
58 |
50 |
tabedit |
tabedit |
59 |
|
let b:uncovOriginalTab = l:originalTab |
|
60 |
51 |
|
|
61 |
52 |
let l:coverage = l:coverageInfo[1:] |
let l:coverage = l:coverageInfo[1:] |
62 |
53 |
let [l:loclist, b:uncovCovered, b:uncoRelevant] = |
let [l:loclist, b:uncovCovered, b:uncoRelevant] = |