Closed dalthviz closed 6 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 87.07%. Comparing base (
0ec5cd3
) to head (f785fe3
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@Czaki, since this is your object, would appreciate your review
This change provides a significant performance boost and I do not see downsides of these changes.
Test failures look unrelated.
Related with https://github.com/napari/napari/issues/6845
Current code computes the full document highlight for each document block/paragraph causing freezes as soon the document content starts to get a little bit long. To reproduce, you can run the
examples/code_highlight.py
, copy and paste the widget text content multiple times (selecting the full content to do a new paste increases the chance to stumble with a freeze in a shorter amount of time). So something like:This PR tries to prevent/improve the situation by only computing the current block content/text highlight data (not sure if there is a better approach so happy to give a check to any other ideas!). Doing a similar check with the example content copy and paste operations with the changes in this PR: