Closed slowsage closed 1 year ago
Thanks for raising a contribution.
Unfortunately, I don't think a regex substitution is the best solution to shortening the displayed path name to only contain relevant information. Personally I am not a big fan of using regex to configure things and would avoid using it anywhere unless I have to.
I'm also not sure what's the point of the match_replacement if we want to stop the displayed path name from containing less redundant information and taking up space if we're going to replace the match pattern with another prefix.
I believe the best way we can handle your problem would be to add a setting that lets us trim duplicate paths in a list of results. Python already has something for this - commonpath or commonprefix. If you're happy with this suggestion, I can raise a PR for that.
When searching from a directory, the full path is shown which is often redundant (and takes up space). This PR lets you do a regex substitution on the displayed path.