limboai
limboai copied to clipboard
WIP: Implement Tree Search Functionality with Highlighting and Filtering
Closes #192
Tested with GDExtension and Module.
Features:
- Tree highlighting: Highlights items that match the search query.
- Counting descendants: Shows the number of matching items within collapsed branches.
- Jump to next match: on enter.
- (Limbo-)Shortcut: Default CTRL-F.
- Menu entry: Misc->Search Tree.
Known issues:
- [x] Unnecessarily redundant signals (af15dde)
- [x] ~~
TreeSearch::_draw_highlight_item
: uses one magic number~~ (same as engine code) - Performance
- [x]
TreeSearch::_find_matching_entries
et al (cc8f099)- Can be solved by making it iterative instead of recursive, using linear push_back instead of insert and sorting once.
- [x] Searches do a whole tree reconstruction for now: Noticeable lag. (https://github.com/monxa/limboai/pull/1)
- [x]
- [x] Editor scaling needs fixing (380f80c)
- [x] ~~Searchbar spacing should be adjusted.~~ (Already similar to Docs/Script search bar with 8c32395)
- [ ] ~~Word highlight drawing might be too obstructive. Especially in filter mode.~~ (Will be solved after this is merged)
- [x] Jumping through entries currently inconsistent (8d29f16, 47706e9)
- [x] Filtering unstable. (74cf985, 465757e)
Wishlist (non-blockers)
- Word highlight drawing might be too obstructive. Especially in filter mode.
-
- [x] Remember separate ~~search-mask~~
SearchInfo
for each tab. (10c8f58)
- [x] Remember separate ~~search-mask~~
-
- [x] Buttons for select next/previous entry (align with script/docs viewport). (ec6c4c3)
- Remember and restore tree collapse on jumping
This pr includes a significant amount of new code (~500 lines). I would greatly appreciate any feedback, especially regarding the known issues listed above.