search icon indicating copy to clipboard operation
search copied to clipboard

Add setting to only show relative path

Open reduf opened this issue 1 year ago • 0 comments

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".

reduf avatar Apr 15 '23 10:04 reduf