On Wed, Dec 3, 2008 at 1:25 PM, Ville M. Vainio <[EMAIL PROTECTED]> wrote:
>
> Here's an idea:
>
> Perhaps syntax highlighting in qt ui could be used via QSyntaxHighlighter:
>
> http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qsyntaxhighlighter.html
>
> The api seems simple enough ("this is the text, format it), and the
> highlighting could probably used existing highlight code to a large
> extent.
>
> It would make the highlighting faster & smarter, and would eliminate
> the need for threads.

Excellent!  I totally missed this class.  As a result, the present
syntax-coloring code is probably 10 to 100 times slower than it could
be.

For example, besides not doing threading properly, the present code
uses a horrid kludge to actually set colors: it calls the (presumably
slow) code to select the desired range, and then colors the range, and
then restores the previous range.

Furthermore, QSyntaxHighlighter is likely the proper place to support
all of Leo's syntax-coloring modes.

I'll look into a re-implementation asap.  Had I known about
QSyntaxHighlighter I would not have written the code as I did.

Edward

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to