camspiers / snap

A fast finder system for neovim.
The Unlicense
483 stars 16 forks source link

ENOENT: no such file or directory error, whilst using the files picker #49

Closed akinsho closed 11 months ago

akinsho commented 3 years ago

Occasionally whilst using the file picker, it errors saying that a particular directory couldn't be found. In the case in this example, the file used to exist but was deleted. I'm not sure why snap still has a reference to it.

Screen Shot 2021-06-24 at 14 25 40

Other instances of this issue involve snap having a reference to the incomplete file path e.g. https://github.com/camspiers/snap/issues/6#issuecomment-866580309 where the file's extension is missing some characters and this error occurs

akinsho commented 3 years ago

A little more information to potentially help debug this information

Screen Shot 2021-06-24 at 16 29 11

I found in a particular work project I was able to reproduce this issue consistently by just entering ., into the prompt. If you look closely the paths of the results have been truncated somehow and I'm guessing snap tries to open these files only to find that they don't exist

beauwilliams commented 3 years ago

I have a similar issue where end of file extension gets cut off occasionally

image

camspiers commented 3 years ago

Can you try shifting to the fzy consumer instead of fzf? this will help me determine if it is fzf that is causing it.

bangedorrunt commented 3 years ago

~I could confirm this only happened with fzf only, found no issue with fzy so far~

My bad, this bug also happened with fzy, but haven't found a way to reproduce it reliably

akinsho commented 3 years ago

I've switched to fzy and will report back since for me the issue is sporadic, or whatever I'm doing to trigger it isn't clear to me, but so far so good.

ahmedelgabri commented 3 years ago

I can reproduce this always using this example https://github.com/camspiers/snap#grep-with-fzf-as-optional-next-step which uses fzf I will try with fzy & see.

akinsho commented 3 years ago

I've had a few episodes whilst also using fzy, in one example I can reproduce the issue seems to be that whilst using vim.buffer I have a log buffer which doesn't exist on my system i.e. it's a scratch buffer with a buftype of nofile. When I try and select it to open in snap, it throws the file doesn't exist error.

...re/nvim/site/pack/packer/opt/snap/lua/snap/common/io.lua:136: ENOENT: no such file or directory: /<my-dir>/a-project/DEV_LOG__
yujinyuz commented 2 years ago

So far I only experience this when I'm using git.file as producer. Is it the same for anybody else?

camspiers commented 11 months ago

Closed with https://github.com/camspiers/snap/commit/ac6ad973589bb74eb15f11219b840f7080e4ed33