Fix #1812400 [Cursor missplace on show_partial_cfi_in_editor() function](https://bugs.launchpad.net/calibre/+bug/1812400)

This commit is contained in:
Kovid Goyal 2019-01-19 11:52:34 +05:30
parent 294ef5a206
commit f0cc46958c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1417,8 +1417,13 @@ class Boss(QObject):
if node is not None:
lnum = node.get('data-lnum')
if lnum:
tags_before = []
for tag in root.xpath('//*[data-lnum="%s"]' % lnum):
tags_before.append(tag)
if tag is node:
break
lnum = int(lnum)
editor.current_line = lnum
editor.goto_sourceline(lnum, tags_before, attribute='id' if node.get('id') else None)
return True
return False