Fix freeze when user template dir points at very large directory tree.#2644
Merged
Fix freeze when user template dir points at very large directory tree.#2644
Conversation
* Honor MAX_TEMPLATES properly * Indicate when too many * Do not show empty directories * Insert root "Template" item when there are templates
This was referenced Oct 3, 2025
|
Can confirm this works around #2643 as detailed in this comment. |
Contributor
Author
|
Thanks @ernstki - hopefully another dev will approve this for merge in due course. |
lenemter
reviewed
Oct 3, 2025
lenemter
approved these changes
Oct 3, 2025
Member
lenemter
left a comment
There was a problem hiding this comment.
One small nitpick. Otherwise code looks good
Insert whitespace Co-authored-by: Leo <lenemter@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2643
The MAX_TEMPLATES constant was not being properly honored resulting in a huge menu structure being made under the circumstances of the linked issue. This is fixed and some other improvements made:
I am uncertain about the "…too many templates" item inserted when MAX_TEMPLATES is reached and this can be removed if desired but in practice it is unlikely to appear I should think as up to 2048 templates are allowed. When the template folder contains this number or more the context menu appears with a slight but tolerable delay on modern hardware.