Merge lp://staging/~desrt/indicator-appmenu/no-zero-indicator-penalty into lp://staging/indicator-appmenu/0.4

Proposed by desrt
Status: Merged
Approved by: Charles Kerr
Approved revision: 203
Merged at revision: 203
Proposed branch: lp://staging/~desrt/indicator-appmenu/no-zero-indicator-penalty
Merge into: lp://staging/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://staging/~desrt/indicator-appmenu/no-zero-indicator-penalty
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Review via email: mp+101556@code.staging.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.

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

looks good.

Thanks for the good description, too...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches