Fix filter on filenames with diacritical marks #21
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.
Related:
Å
andå
#19Issue
Can't filter on file names with å and Å. In looking for a fix, I found it it's called characters with diacritical marks
Solution
I got some help from ChatGPT.
This solution normalizes words by splitting the diacritical marks in the filter function, so now
forhånd
andforhand
result in the same files. Before, when trying to filter onforhåndsvisning
, I had to stop afterforha
, because the filter didn't match anymore (in the filename, the å was split up in a and º, but I couldn't type that in the filter of course).After it has normalized the characters, it then removes the diacritical marks. They're still displayed in the overview, but in the filter function, they are ignored.
Impact
I can't imagine this will have any impact on either the codebase, performance or backwards compatibility. It'll only impact users (positively!) who work with alphabets with diacritical characters
Usage Changes
Filter now supports filtering on words with diacritical characters
Considerations
I got help from ChatGPT to fix this. I think it's a good idea if a "real" developer takes a good look at the solution before merging it into the main branch.
Testing
No unit tests included, but I also doubt there has to be a unit test for such a small addition?