8000 Add setting to only show relative path · Issue #20 · reduf/search · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add setting to only show relative path #20
Open
@reduf

Description

@reduf

Feature request originally from issue #19.

One interesting option, especially when searching only 1 path, would be to print the path relative to the directory that initiated the search. ripgrep does it, but it's unfortunately not easily usable for us.

Whenever a new file is found, the path given by the "ignore" crate is relative to the path we initially specified. When using ripgrep, this initial path is usually relative to the working directory. So, you can observe the following:

> rg -iF fn dir1 dir2
dir2\f2.txt
1:fn

dir2\dir3\f3.txt
1:fn

dir1\f1.txt
1:fn

The issue is that from the GUI, we don't really want to have path relative to the working directory, so we make sure the path are absolute. This means, whenever we process a file with matches, we only know the absolute path and we don't know the original path from which the walk originated. Since there can be multiple path, it's not easily possible to find.

We should be able to do a PR and add this feature to ripgrep.

From a setting point of view, we could have radio boxes with 3 options: "Full path", "File name", "Relative path".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0