Skip to content

Conversation

ron0studios
Copy link
Contributor

@ron0studios ron0studios commented Oct 3, 2022

Improved fuzzy matching so that it finds the longest matching icon instead of the first possible match

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

This improves the fuzzy-match option in a few modules, such as the i3 module. Instead of matching the first applicable substring, the option will now search through and find the longest matching substring.

Related Issues & Documents

Closes #2829
Fixes #2095 (similar issue)

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

ron0studios and others added 2 commits October 3, 2022 19:42
Improved fuzzy matching so that it finds the longest matching icon instead of the first possible match
@ron0studios
Copy link
Contributor Author

please let me know if I've forgotten anything, this is my first PR 😄

@ron0studios ron0studios marked this pull request as ready for review October 3, 2022 18:58
@ron0studios ron0studios changed the title better fuzzy matching added: better fuzzy matching Oct 3, 2022
@ron0studios
Copy link
Contributor Author

just removed the debug output, should fix the workflow check fails

@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Merging #2831 (27a9a01) into master (5719d13) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2831      +/-   ##
==========================================
+ Coverage   13.40%   13.48%   +0.08%     
==========================================
  Files         151      151              
  Lines       11499    11506       +7     
==========================================
+ Hits         1541     1552      +11     
+ Misses       9958     9954       -4     
Flag Coverage Δ
unittests 13.48% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/drawtypes/iconset.cpp 81.81% <100.00%> (+38.06%) ⬆️
src/modules/xwindow.cpp 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

- added return statements to the fuzzy finder
- added tests to check whether the fuzzy finder works.
Copy link
Contributor Author

@ron0studios ron0studios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just made some more commits with the given changes

Copy link
Contributor Author

@ron0studios ron0studios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fully finished implementing all changes in the recent commit

Copy link
Contributor Author

@ron0studios ron0studios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Copy link
Member

@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some minor style changes. Please also run clang-format on the files you changed. https://polybar.readthedocs.io/en/latest/dev/style-guide.html

@ron0studios
Copy link
Contributor Author

ron0studios commented Oct 5, 2022

there is still a pending requested change, but don't worry as I've just implemented those changes myself and the conversation was made outdated. All the relevant changes have been applied.
Apologies for all the mistakes again, thank you!

I'm trying to submit this pull request for hacktoberfest so it is my first time for a bigger project!

@patrick96
Copy link
Member

Apologies for all the mistakes again, thank you!

There is no need to apologize, review cycles are part of the process ;)

Thank you for contributing to polybar!

@patrick96 patrick96 merged commit 3030152 into polybar:master Oct 5, 2022
@patrick96
Copy link
Member

Congrats on your first PR in polybar 🚀

@patrick96 patrick96 mentioned this pull request Nov 5, 2023
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Better fuzzy matching for icon sets (i3, bspwm) conflict between icon for i3wm workspace label "1" and "10" when display by polybar
2 participants