> On Mon, Jul 1, 2013 at 8:14 AM, Ville M. Vainio <[email protected]>wrote:
>
>> Could we start by doing the coloring as we do now, but only request it ~
>> 1sec after the node has been selected? This way, you wouldn't see the
>> slowdown from coloring when quickly moving around with cursor keys.
>
>
The more I think of this topic, the more, um, "interesting"  it becomes.

And I was wrong about qsh being just a wrapper.  There is some "real" code
in the class.  For example: QSyntaxHighlighterPrivate::reformatBlocks.

By creating our own version of this code it may be possible to
"interruptable" coloring.  The idea is to stop coloring when any event
appears.  Of course, the problem then becomes how to restart coloring!  The
answer will depend on whether the event causes the text to change.

Perhaps this is a harder problem than I thought, or maybe the Qt people
just never thought that an interruptable syntax colorer would be useful.

There are no guarantees, but a plausible first step would be to rewrite qsh
in Python.  That way we will have full control over the scheduling of calls
to (the overridden) highlightBlock method.  This is the gateway to all of
Leo's colorizing code.  It calls the top-level recolor method, providing we
aren't in @killcolor mode.

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/groups/opt_out.


Reply via email to