mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-20 14:36:08 +01:00
Fix #1812400 [Cursor missplace on show_partial_cfi_in_editor() function](https://bugs.launchpad.net/calibre/+bug/1812400)
This commit is contained in:
parent
294ef5a206
commit
f0cc46958c
1 changed files with 6 additions and 1 deletions
|
|
@ -1417,8 +1417,13 @@ def show_partial_cfi_in_editor(self, name, cfi):
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue