Thanks Lars :-)
Here's an update of the gtk IDE which loads source files exponentially faster.
Alas, for this to happen, it requires an IDE hack and a gtk-only feature of the TextArea.
For the 1 or 1.5 people that are interested in the technicals.... ;-)
... The gtk TextBuffer does colouring using what are called Tags. You simply create a tag of attributes you'd like to apply to some text then set some area of the text with it. It even has a TagTable that lets you cache different types of tag so you can reuse them.
All great and good... but there are some problems when plugging this into max... When you add a new tag it becomes the tag with the highest priority. Therefore if you were to apply colour to a word, and then apply a different color using a tag created before it, it would still show the other color. Ack... what to do? Fortunately, you can remove tags before applying them to the given text. Alas, you need to do a "remove all tags" on the area to clear it first, which is slowwwww.
So imagine doing the following for each syntax highlighted word :
remove old tags
apply new tag
...loading anything more than a few hundred lines of code is mind-numbingly slow.
My hack...
The IDE knows which section of text it wants to re-apply the colouring to (be it the complete file on loading, or the current line etc), and it first sets that whole area to the default style before iterating through and highlighting it. This is good... I add some code which flicks a "fastUpdate" flag to OFF when it "clears" the highlighting (enabling the remove tags functionality), and the set it ON for the highlighting (which doesn't perform and remove tags, since it doesn't have to!).
And it's *very* fast.
Even better was running the CE lexer test on it.
On my libxml mod (3000+) without the hack, I almost fell asleep waiting for it to show the code. With the hack, it was quick between 1-2 seconds. I doubled up the code to nearly 7000 lines and it took the same amount of time!
Anyhoo... this is the problem trying to kludge a specific UI to work in a standard cross-platform implementation....
Oh, and I also added a SetPointer to the source loader so you see a "wait" pointer while it loads, so you can see it's doing something... (should have been there anyway IMHO)
Have fun :o)
Here's an update of the gtk IDE which loads source files exponentially faster.
Alas, for this to happen, it requires an IDE hack and a gtk-only feature of the TextArea.
For the 1 or 1.5 people that are interested in the technicals.... ;-)
... The gtk TextBuffer does colouring using what are called Tags. You simply create a tag of attributes you'd like to apply to some text then set some area of the text with it. It even has a TagTable that lets you cache different types of tag so you can reuse them.
All great and good... but there are some problems when plugging this into max... When you add a new tag it becomes the tag with the highest priority. Therefore if you were to apply colour to a word, and then apply a different color using a tag created before it, it would still show the other color. Ack... what to do? Fortunately, you can remove tags before applying them to the given text. Alas, you need to do a "remove all tags" on the area to clear it first, which is slowwwww.
So imagine doing the following for each syntax highlighted word :
remove old tags
apply new tag
...loading anything more than a few hundred lines of code is mind-numbingly slow.
My hack...
The IDE knows which section of text it wants to re-apply the colouring to (be it the complete file on loading, or the current line etc), and it first sets that whole area to the default style before iterating through and highlighting it. This is good... I add some code which flicks a "fastUpdate" flag to OFF when it "clears" the highlighting (enabling the remove tags functionality), and the set it ON for the highlighting (which doesn't perform and remove tags, since it doesn't have to!).
And it's *very* fast.
Even better was running the CE lexer test on it.
On my libxml mod (3000+) without the hack, I almost fell asleep waiting for it to show the code. With the hack, it was quick between 1-2 seconds. I doubled up the code to nearly 7000 lines and it took the same amount of time!
Anyhoo... this is the problem trying to kludge a specific UI to work in a standard cross-platform implementation....
Oh, and I also added a SetPointer to the source loader so you see a "wait" pointer while it loads, so you can see it's doing something... (should have been there anyway IMHO)
Have fun :o)