More background for git bug 28:
https://github.com/leo-editor/leo-editor/issues/28
There is no way around it: loading more than 10K lines of text into the
body pane will be slow.
However, when moving around the outline, we often want just to move *past*
a large node. This suggests the following strategy.
1. Let w be a LeoQTextEditWidget. w.setAllText will load small text as
usual. For large text, w.setAllText will do the following:
- Put 'Loading...' in the body pane.
- Lock/disable w, preventing user edits.
- set w.leo_loading = True
- set w.leo_loading_p = w.c.p.copy()
- queue up w.load_text at idle time.
This has the potential for big problems. Happily this scheme can probably
be made safe as follows:
2. Define w.getAllText as follows:
def getAllText(self):
w = self.widget
if w.leo_loading:
return w.leo_loading_p.b
else:
return g.u(w.toPlainText())
3. At idle time, w.load_text will loads the text, but *only* if w.c.p ==
w.leo_loading.
In any case, w.load_text will clear w.leo_loading and w.leo_loading_p.
===== Conclusion
This looks like a viable strategy, but it will require substantial testing.
There will have to be a delayed_load switch to enable/disable this feature.
Your comments, please.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.