Attached is a simple patch that improves syntax highlighting
performance. Opening a large .sc file (6500 lines) previously took
about 10 seconds of beach balling, with the patch it opens
instantly. It works by changing the text color via textStorage
(rather than the text view) and wrapping the entire colorization
loop in beginEditing and endEditing calls. Why this improves
performance is documented here:
http://developer.apple.com/documentation/Cocoa/Conceptual/
TextEditing/Tasks/BatchEditing.html
I also cleaned up the code a bit.
Ryan
<syntaxColorize.M.patch>
_______________________________________________
sc-dev mailing list
sc-dev@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev