View Single Post
Old 06-19-2014, 05:50 PM   #3
Nebucad
Member
Nebucad began at the beginning.
 
Nebucad's Avatar
 
Posts: 14
Karma: 10
Join Date: Jun 2014
Location: Nürnberg - Germany
Device: Kindle 4 - Gen. 5
Tweeking the recalculation process

Quote:
Originally Posted by kovidgoyal View Post
When any change is made to a very long file, the entire syntax highlighting for the rest of the file might need to be recalculated (depending on the change). The HTML syntax highlighter in the editor actually keeps track of tag nesting in order to be able to provide inline language dependent spellchecking. Which means that editing long files will be slow. Split your files. Having huge files is almost never a good idea.
Is it possible to tweek the recalculation option?

I figured out calibre editor has little problems to handle big .html file in generally. Even splitting a file take a "long time". Once it caused an script error as well and i fear couldn't split the file at all. I wait until error poped up and push the stop btn. afterwards i could split the file. Later when the file droped blelow 700-800kb it works fine and faster.

I got editing timewaits if a file is bigger than 100kb or close to it. I noticed the recalculating starts if:

* adding "class=" into a tag, start at the point when I type "="
* type in "<" starts recalculation, even inside a html-Tag i.e. <TAG> "<" </TAG>
* if I remove the closing TAG (any TAG) i.e. <h1><b>BLA BLA</b><h1> removing the "</b>"-TAG cause an recalculating

To avoid the recalculating I always mark a TAG completely before I hit the del btn. and I start to remove the Opening-TAG first.

The 2nd step i use copy and past i.e. "class="xx"" this avoid recalculating as well.

If the file is smaller i guess until 50-70kb everything runs fine and fast enough for editing.

I suggest to set a delay for the calculating or increase the value.
Nebucad is offline   Reply With Quote