diff --git a/autoload/go/coverage.vim b/autoload/go/coverage.vim index 6f3bdc52cf..31bafadbf8 100644 --- a/autoload/go/coverage.vim +++ b/autoload/go/coverage.vim @@ -224,7 +224,7 @@ function! go#coverage#overlay(file) abort let cnt += 1 endwhile - let fname = expand('%:t') + let fname = expand('%') " when called for a _test.go file, run the coverage for the actuall file " file @@ -241,6 +241,9 @@ function! go#coverage#overlay(file) abort exe ":edit ". fnamemodify(fname, ":p") endif + " cov.file includes only the filename itself, without full path + let fname = fnamemodify(fname, ":t") + for line in lines[1:] let cov = go#coverage#parsegocoverline(line)