Skip to content

Commit c8cba1b

Browse files
committed
Merge pull request #27 from jhogendorn/master
Use relative filepaths so differing envs play nice
2 parents cfa37dd + 6b66ee6 commit c8cba1b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugin/python/codecoverage.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ except NameError:
1616

1717
clover = vim.eval('a:clover')
1818
buf = vim.eval('bufname("%")')
19-
fileName = vim.eval('fnamemodify("'+buf+'",":p")')
19+
fileName = vim.eval('fnamemodify("'+buf+'","%")')
2020

2121
"""
2222
XML may already be parsed and held in memory
@@ -41,7 +41,7 @@ try:
4141
mtime = time.ctime(os.path.getmtime(clover))
4242

4343
ctxt = doc.xpathNewContext()
44-
res = ctxt.xpathEval("//file[@name='"+fileName+"']/line[@type='stmt']")
44+
res = ctxt.xpathEval("//file[substring(@name, string-length(@name) - string-length('"+fileName+"') + 1)='"+fileName+"']/line[@type='stmt']")
4545
cur_signs = int(vim.eval('g:phpqa_num_cc_signs'))
4646
showcovered = int(vim.eval('g:phpqa_codecoverage_showcovered'))
4747
cmd_list = ''

0 commit comments

Comments
 (0)