Closed SoapyDev closed 1 week ago
Strings are UTF-8 encoded, and thus characters can differ in the amount of length they take up in the string (string length is measured in bytes, not human readable characters). Try inputting one special character which takes up more than 1 byte, then another character of any type. The program will immediately panic. That, in addition to the fact that you're using these iterators to remove singular characters, shows that Vec<char>
would be a much better choice.
Take a look at https://github.com/lj3954/linutil/tree/pr_176, I've added 2 commits that would probably be helpful.
Thanks for the fix!
Will happily wait for the merge of #177
Also add navigation related to the cursor
Pull Request
Title
Add a cursor to the search bar
Type of Change
Description
Add a cursor to the search bar when in focus. Also allow the user to move forward, backward and to insert and delete on position.
Testing
Manual testing
Impact
Improve usability for end user.
Additional Information
https://github.com/user-attachments/assets/f105df19-55fe-403b-a4ba-805f2ba75a55
Checklist