On 3/5/07, SPE Stani's Python Editor <[EMAIL PROTECTED]> wrote:
Realtime updating is also which belongs to the generic part. Therefore we need to be able to diffs between a previous state and a current state and to add a property expanded (True/False) to the nodes. Again if we implement this in a generic way, we get everything for free for all languages.
I actually implemented a variant of 'diff in place' method for trees after seeing yours. It doesn't handle renames very well (it ends up recreating the subtree of a named node), but it seemed to speed up the tree manipulations that PyPE was doing. I need to release a new version of PyPE soon, so I'll let everyone know where the code can be found when it is available. Another thing is that fold explorer will be a good tool for what I
will define local code blocks. For example now SPE compiles the whole file to check for syntax errors which SPE underlines with a red marker. With Scintilla we could get the visible lines on the screen, fetch which codeblocks are involved from the fold explorer and than we need only to compile these blocks to check for syntax errors. This means for huge files only a very small proportion is shown on the screen, so you could have realtime syntax checking there. Maybe with subprocesses this could be done also for other languages as python. This would be amazing.
I have considered local code blocks, but I don't believe that they are really all that practical. You end up needing to update line numbers for all later code blocks anyways, so you may as well just do the entire thing. What I have found works reasonably well is to update syntax errors and trees after a delay that is a function of how long it took to generate the information the last time. When generating, I have a secondary thread do the compilation, etc., to allow the main thread to do its business of letting people edit, etc., then taking control to update controls, etc. The only issue is that you can't use the standard STCStyleEditor.py to handle style setting, as it uses the wx.FileConfig class, which seems to have threading issues ( http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?11:mss:47836:200602:nmkejbkeoodckphegicd). If you switch to the StyleSetter.py that is included with PyPE, you should be able to use multiple threads at the same time (PyPE has been doing so for over a year now). - Josiah
