Closed lj3954 closed 1 week ago
Looks good.
I just have a question. Why did you choose the names filter.rs
and FilterContent
?
I know search is used to filter items from the commands list, but it seems weird to call the whole search bar a filter, and call methods such as filter.draw()
, which are actually drawing the search bar.
The logic for filtering entries, regardless of whether or not a search query is present, was moved to the file. It encapsulates significantly more than just search. Perhaps the draw() function should be renamed to draw_searchbar() or something of the like.
Pull Request
Title
Move filter and search logic to another module
Type of Change
Description
Move all logic related to search and filtering to a separate module, which AppState calls upon. Replace 'search.rs' with 'filter.rs' to better enumerate the logic contained within. Additionally, add the cursor to the search bar (#176), with fixes for panics with multibyte unicode characters & incorrect cursor positioning with characters taking up a non-singular amount of columns.
Testing
Search functions correctly, searchbar and cursor are rendered correctly.
Impact
Improves code structure & readability
Checklist