ibhagwan / fzf-lua

Improved fzf.vim written in lua
GNU Affero General Public License v3.0
2.15k stars 141 forks source link

With path_shorten on, I can't find files by typing their full names #1009

Closed amagee closed 7 months ago

amagee commented 7 months ago

Info

Description

With path_shorten=true, I need to type the shortened paths to find the files I want; typing the original paths does not find the files.

For example, if my repository contains

/setup/client/somefile1.txt /setup/server/somefile1.txt

And I do :lua require("fzf-lua").git_files({path_shorten=true})

Then s/s and s/c will find files, but setup will find nothing.

It's not clear to me if this is intentional, but it's not what I would expect. I see the path shortening as a rendering / output setting, not one that would affect the fuzzy search behaviour.

ibhagwan commented 7 months ago

It's not clear to me if this is intentional, but it's not what I would expect.

This is intentional, with fzf the data is passed to an outside process (fzf), without hidden metadata, there is no way for fzf to match based on the full path as it does not exist in that context.

Currently I have no plans on adding hidden metadata with full paths for path shorten as this will slow down considerably and consume too much memory on large repos.

amagee commented 7 months ago

Ok, fair enough. I will see if I can hack it on the fzf side.