Skip to content

Commit

Permalink
Merge pull request #1128 from fatih/fix-coverage-syntax
Browse files Browse the repository at this point in the history
coverage: no need to change turn on/off syntax
  • Loading branch information
fatih authored Nov 25, 2016
2 parents eeae7b0 + 10a8ddc commit 309c94f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions autoload/go/coverage.vim
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,14 @@ endfunction

" Clear clears and resets the buffer annotation matches
function! go#coverage#Clear() abort
" only reset the syntax if the user has syntax enabled
if !empty(&syntax)
if exists("g:syntax_on") | syntax enable | endif
endif
call clearmatches()

if exists("s:toggle") | let s:toggle = 0 | endif

" remove the autocmd we defined
if exists("#BufWinLeave#<buffer>")
autocmd! BufWinLeave <buffer>
endif

call clearmatches()
endfunction

" Browser creates a new cover profile with 'go test -coverprofile' and opens
Expand Down Expand Up @@ -256,8 +251,6 @@ function! go#coverage#overlay(file) abort
call extend(matches, go#coverage#genmatch(cov))
endfor

syntax manual

" clear the matches if we leave the buffer
autocmd BufWinLeave <buffer> call go#coverage#Clear()

Expand Down

0 comments on commit 309c94f

Please sign in to comment.