Skip to content

Fuzzy matcher should favour whole words #3208

Closed as not planned
Closed as not planned

Description

@davep

[Meta: note that changes to the fuzzy matcher are in process in #3058 -- this is mostly a reminder to myself to either make this change there are do this as a close followup once the PR is merged]

The fuzzy matcher should favour finding a complete word over finding the start of the letter collection as early as possible. The issue can be seen here:

Screenshot 2023-08-30 at 14 52 55

poo should match poo in pile_of_poo (and so giving a higher score) in preference to matching the earlier instances of p and o.

Activity

  1. self-assigned this
    on Aug 30, 2023
  2. removed their assignment
    on Jun 21, 2024
  3. gunslingerfry commented on Feb 14, 2025

    @gunslingerfry

    @davep this still seems to be happening, but even more weirdly. I'm using it for searching through paths and it is very odd. I'm using fzf to do the searching right now because it is incorrectly eliminating results (but fzf doesn't do highlighting so Matcher is doing the highlighting).

    Image

    You will see that SimplePropertyLabel, PropertyLabelRetestButton, and RollableLabel aren't highlighted because Matcher incorrectly eliminated those but fzf did not. On PropertyTextInput you see it is picking up text from the right side and as soon as I add 't' to my query it also is incorrectly eliminated.

    (thanks for all your work on this awesome TUI framework)

  4. davep commented on Feb 14, 2025

    @davep
    ContributorAuthor

    @gunslingerfry Note that this is quite an old issue, and also I've not been involved with Textual for quite some time now. I think I saw mention that the maintainer made some changes to the default matcher; it might be sensible for you to raise an issue if you feel you've found a problem.

  5. gunslingerfry commented on Feb 14, 2025

    @gunslingerfry

    My apologies. I will create a new issue. Thanks!

  6. github-actions commented on Jun 4, 2026

    @github-actions

    I hope I solved your issue!

    Consider sponsoring my work to continue to maintain and develop Textual.

    • Will McGugan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions