Thread: CFI Parser
View Single Post
Old 01-18-2019, 05:18 AM   #12
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,221
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by kovidgoyal View Post
Probably a performance optimization
Hi, Kovid.

I didn't notice any impact on performance. Running ACE with the plugin takes roughly the same time as with the command line tool (on my sistem, the diference is around 0.3s).

When I click on a message (wich uses the CFI function), the file opens instantaneously, with the cursor on the right line.

Quote:
Originally Posted by kovidgoyal View Post
see if it can be implemented for at least a couple of lines without too much impact.
I'm attaching the plugin, in case you want to test it yourself (if you have the ACE tool installed, anyway).
I've incorporated your code into the plugin for older versions of calibre, and let it run normally for the 3.38 and later versions.

Take a look at the go_to_line() function.


--------------

As for the issue itself, its not about the position of the ID, as I supected before. It affects any attribute wich spans for 2 "lines". The cursor will be placed at the end of that attribute value.


P.S.: in case you need a book to test, use the attached file (scrambled). The issue is more easily noticed on the footnote references (when ACE complains about the correspondent ARIA role for it, doc-noteref).
Attached Files
File Type: zip ACE.zip (67.8 KB, 247 views)
File Type: epub Sample_scrambled.epub (439.1 KB, 260 views)
thiago.eec is offline   Reply With Quote