Merge lp:~desrt/indicator-appmenu/no-zero-indicator-penalty into lp:indicator-appmenu/0.4
Status: | Merged |
---|---|
Approved by: | Charles Kerr |
Approved revision: | 203 |
Merged at revision: | 203 |
Proposed branch: | lp:~desrt/indicator-appmenu/no-zero-indicator-penalty |
Merge into: | lp:indicator-appmenu/0.4 |
Diff against target: |
12 lines (+3/-0) 1 file modified
src/hudresult.c (+3/-0) |
To merge this branch: | bzr merge lp:~desrt/indicator-appmenu/no-zero-indicator-penalty |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Charles Kerr (community) | Approve | ||
Review via email: mp+101556@code.launchpad.net |
Description of the change
hud: never allow perfect match for indicators
The old scoring algorithm would assign a penalty of one for searching
for "item" and finding "Item" (due to the case). The new algorithm
ignores case.
This caused an unintended problem: the fact that we would never get
perfect matches (due to the fact that nobody ever properly capitalised
their search strings) was a good thing. The indicator penalty is
expressed as a percentage by which to increase whatever the distance
already was, and that doesn't work well with the now-common case of a
perfect match (since 0 + 50% is still 0).
We tweak this situation by never allowing a match from an indicator have
a perfect score. If the indicator penalty is requested, then the
distance must be at least 1.
looks good.
Thanks for the good description, too...