What do you think?
It might cause a slight delay which can be visible. Do you experience such after the patch?
Yes, I can see the visible delay. For example, a project have four files: a.cpp, b.cpp, c.cpp, d.cpp, when project loaded, a.cpp and b.cpp will be opened automatically, suppose b.cpp is the active editor.
The old code is that when finish parsing the project, the opened editors(a.cpp and b.cpp) will be colourised. When I switch to a.cpp, the a.cpp will colourised again, but you don't notice the visible delay, because a.cpp is already colourised. While, if you double click on the c.cpp in the project manager tree, c.cpp will opened and activated, and you notice the visible delay on c.cpp.
After my patch, after parsing the project, only b.cpp(the active editor) will be colourised, when you switch to a.cpp or open c.cpp, you will notice the visual delay.
BTW: I notice that if I double click on the c.cpp in the project file tree, I will receive many editor active events, see below:
20:40:00,156 => cbEVT_EDITOR_DEACTIVATED
20:40:00,156 => cbEVT_EDITOR_SWITCHED
20:40:00,156 => cbEVT_EDITOR_ACTIVATED
Mozilla universal detection engine detected 'Pure *ASCII*'.
Final encoding detected: Windows Chinese Simplified (CP 936) (ID: 28)
Conversion succeeded using wxCSConv (buffer size = 143129, converted size = 143130.
20:40:00,218 => cbEVT_EDITOR_OPEN
20:40:00,250 => cbEVT_EDITOR_SWITCHED
20:40:00,250 => cbEVT_EDITOR_ACTIVATED
20:40:00,250 => cbEVT_EDITOR_SWITCHED
20:40:00,250 => cbEVT_EDITOR_ACTIVATED
20:40:00,265 => cbEVT_EDITOR_UPDATE_UI
NativeParser::GetAllPathsByFilename(): Traversing 'F:\cb_sf_git\trunk\src\plugins\codecompletion\parser' for: parserthread.*
NativeParser::GetAllPathsByFilename(): Found 2 files:
- F:\cb_sf_git\trunk\src\plugins\codecompletion\parser\parserthread.cpp
- F:\cb_sf_git\trunk\src\plugins\codecompletion\parser\parserthread.h
ClassBrowser::OnThreadEvent(): Updating class browser...
20:40:00,687 => cbEVT_EDITOR_UPDATE_UI
ClassBrowser::OnThreadEvent(): Class browser updated.
This is reported by Jens' event monitor plugin. when a new file "parserthread.cpp" is opened by double click on the project manager tree. Not sure why, but I think that's one reason why we need an "editor active timer delay", thus we can only handle the last activated editor event.