Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nucleo-matcher: Is there no way to turn off "match_paths" in the matcher config? #52

Open
markus-bauer opened this issue Oct 8, 2024 · 1 comment

Comments

@markus-bauer
Copy link

See title.

There's set_match_paths, but it doesn't take a bool.

@evbo
Copy link

evbo commented Nov 25, 2024

@markus-bauer it is a function that sets delimiter_chars to match filesystem paths (depending on os): https://docs.rs/nucleo-matcher/0.3.1/src/nucleo_matcher/config.rs.html#49

Could we make all fields public? For instance, only _ is a legal delimiter in my case but I have no way to set that:

pub struct Config {
    /// Characters that act as delimiters and provide bonus
    /// for matching the following char
    pub(crate) delimiter_chars: &'static [u8],
    /// Extra bonus for word boundary after whitespace character or beginning of the string
    pub(crate) bonus_boundary_white: u16,
    /// Extra bonus for word boundary after slash, colon, semi-colon, and comma
    pub(crate) bonus_boundary_delimiter: u16,
    pub(crate) initial_char_class: CharClass,

    /// Whether to normalize latin script characters to ASCII (enabled by default)
    pub normalize: bool,
    /// whether to ignore casing
    pub ignore_case: bool,
    /// Whether to provide a bonus to matches by their distance from the start
    /// of the haystack. The bonus is fairly small compared to the normal gap
    /// penalty to avoid messing with the normal score heuristic. This setting
    /// is not turned on by default and only recommended for autocompletion
    /// usecases where the expectation is that the user is typing the entire
    /// match. For a full fzf-like fuzzy matcher/picker word segmentation and
    /// explicit prefix literals should be used instead.
    pub prefer_prefix: bool,
}

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

No branches or pull requests

2 participants