Should be passing barenames to goto_sourceline

This commit is contained in:
Kovid Goyal 2019-01-20 12:57:16 +05:30
parent fd5ea1552e
commit 804e3fbf1c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1414,16 +1414,20 @@ class Boss(QObject):
editor.get_raw_data(), decoder=lambda x: x.decode('utf-8'), editor.get_raw_data(), decoder=lambda x: x.decode('utf-8'),
line_numbers=True, linenumber_attribute='data-lnum') line_numbers=True, linenumber_attribute='data-lnum')
node = decode_cfi(root, cfi) node = decode_cfi(root, cfi)
def barename(x):
return x.tag.partition('}')[-1]
if node is not None: if node is not None:
lnum = node.get('data-lnum') lnum = node.get('data-lnum')
if lnum: if lnum:
tags_before = [] tags_before = []
for tag in root.xpath('//*[data-lnum="%s"]' % lnum): for tag in root.xpath('//*[data-lnum="%s"]' % lnum):
tags_before.append(tag) tags_before.append(barename(tag))
if tag is node: if tag is node:
break break
else: else:
tags_before.append(node) tags_before.append(barename(node))
lnum = int(lnum) lnum = int(lnum)
return editor.goto_sourceline(lnum, tags_before, attribute='id' if node.get('id') else None) return editor.goto_sourceline(lnum, tags_before, attribute='id' if node.get('id') else None)
return False return False