davatorium / davatorium/rofi

[REQUEST] Fuzzy matching algorithm can be improved - about sorting, not matching

Open
#2,139 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
C
Stars
16.4k
Forks
696
Avg merge
20h 46m
Merged PRs (30d)
1

Description

Before opening a feature request
  • I checked the next branch to see if the feature has already been implemented
  • I searched existing reports to see if it is already requested.
What is the user problem or growth opportunity you want to see solved?
Before anything, thank you for this wonderful tool.

One picture is worth a thousand words

Expected behavior

"Fire" should place "fire" emoji on top.

Problem identificaiton

The current fuzzy matching algorithm implementation is simple, but it works !
In some cases though, it really does not help the user achieve what they intended. I think it could be improved a bit, without any drawback on performance.

Solution proposal

I worked a lot with fuzzy matching in the past and I see exactly how to fix this. I will create a PR for that if you confirm that it has a chance to be merged.

How do you know that this problem exists today? Why is this important?

Its important because Rofi is all about searching through a list, and getting the right result for the right query is important.

Who will benefit from it?

Every Rofi user

Rofi version (rofi -v)

1.7.5

Configuration

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported example in Rofi 1.7.5: searching for “Fire” should rank the “fire” emoji first. The issue does not identify an implementation file or test, so locate the fuzzy-matching and sorting entry points before defining the change. Done means the expected ordering is reproduced by an automated test without a performance regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.