-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calls won't update if not visible #63
Comments
(this is only the case if the calls are not selected (not blue)) |
I thought I'd fixed this really early on! Let me check it out and see what's regressed. Thanks for the report. |
You're using Brackets 0.41, right? |
I think I can reproduce the problem.
Expected: it says "1 call" next to If you skip step 4, it says "1 call" as expected. DiagnosisCodeMirror removes those call count pills from the DOM for efficiency as you scroll around. When Theseus does a batch update of all the hit counts, it minimizes DOM access by only updating counts for the functions that have been called since the last update. But it also checks for pills that have been added back by CodeMirror to give them their most up-to-date value, even if the corresponding functions weren't called in the current batch. It has to do that because it used to be that, when CodeMirror re-added a pill, it inserted the HTML that was originally used to create it, so any changes (such as updating the number and changing the style) were reversed. Theseus took advantage of that by adding an "uninitialized" class to that initial HTML, so it could find re-added pills by looking for nodes with the "uninitialized" class. My theory is that the latest CodeMirror actually adds the original DOM node back (with all subsequent changes) instead of creating a new node with the original HTML. That explains why it works if you don't scroll far enough for the pill to be on the screen and have its "uninitialized" flag cleared, but doesn't work if you do scroll down. If the theory is correct, then instead of looking up DOM nodes by ID to update them (which I only did because CodeMirror would destroy and recreate the nodes whenever it felt like it), Theseus can retain a pointer to the DOM nodes for the pills and update them directly, always. Time to experiment! |
Hi,
the calls counter won't update if not visible. Only if executed when visible they will update again (and then e.g. jump from 10 to 12).
The text was updated successfully, but these errors were encountered: