Skip to content

(Potentially) incorrect handling of trailing \ in MultiPattern::reparse #66

@alexrutar

Description

@alexrutar

The docs for MultiPattern::reparse explain that the 'append' argument should be set to true if the new query string contains the old query string as a prefix.

However, it seems to me that this does not consider the case when there is a trailing \? I had to add this extra check downstream in nucleo_picker in order to get proper search results.

It seems plausible to me that this is also a bug in helix: https://github.com/helix-editor/helix/blob/db1d84256fbae21abb3ba46943fb1abb8e211355/helix-term/src/ui/picker.rs#L539

I guess either this is actually an error (and the reparse method should be fixed) or it should be clarified in the documentation that one also needs to check for the presence of a trailing \.

Edit: Seems to be a missing check here

nucleo/src/pattern.rs

Lines 53 to 59 in d17e29a

if append
&& old_status != Status::Rescore
&& self.cols[column]
.0
.atoms
.last()
.map_or(true, |last| !last.negative)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions