Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FilesWithDevicons fails #7

Open
iameru opened this issue Feb 18, 2023 · 7 comments
Open

FilesWithDevicons fails #7

iameru opened this issue Feb 18, 2023 · 7 comments

Comments

@iameru
Copy link

iameru commented Feb 18, 2023

:GFilesWithDevicons and :RgWithDevicons work great.

:FilesWithDevicons on the other hand opens the fzf window but just shows

[Command failed: | devicon-lookup]

Not sure where to start looking for the why.

NVIM v0.8.3
Dev Icon Lookup v0.8.1
latest fzf.devicon.vim
@coreyja
Copy link
Owner

coreyja commented Feb 18, 2023

Hey @iameru!

Hmm I don't think I can reproduce this on my end...

What is your FZF_DEFAULT_COMMAND env var set to?
https://github.com/coreyja/fzf.devicon.vim/blob/master/autoload/fzf/devicon/vim.vim#L368

That is used in FilesWithDevicons to determine what to run to search for files

Since your other devicon-lookup commands are working it feels like the devicon-lookup binary and everything is working well

Thanks for trying out fzf.devicon.vim! Hope we can get this resolved for ya

@iameru
Copy link
Author

iameru commented Feb 21, 2023

What is your FZF_DEFAULT_COMMAND env var set to? https://github.com/coreyja/fzf.devicon.vim/blob/master/autoload/fzf/devicon/vim.vim#L368

I don't have it set apparently, but have devicons in my Path

~$ echo "$FZF_DEFAULT_COMMAND"

~$ which devicon-lookup
/home/user/.cargo/bin//devicon-lookup

I hope aswell. It's nice to have visual feedback in my editor. Not using Files that often though so its not soooo important but maybe we can find the reason

@coreyja
Copy link
Owner

coreyja commented Feb 21, 2023

@iameru Can you try setting that env var as a work around for right now?

Mine is set to this to use rg

rg --files --no-ignore --hidden --follow --glob "!.git/*" 2> /dev/null

Haven't been in this code base in awhile lol, but I'm not actually seeing a fallback if $FZF_DEFAULT_COMMAND isn't defined in code right now...
So that might be the issue!

Will try to get that patched if setting the env var works for ya!

@iameru
Copy link
Author

iameru commented Mar 10, 2023

got some time to try again. Still an error [Command failed: | devicon-lookup
when using :FilesWithDevicons.

$ echo "$FZF_DEFAULT_COMMAND"                                                                                                                   13.7s
rg --files --no-ignore --hidden --follow --glob "!.git/*" 2> /dev/null

2023-03-10-112536_821x243_scrot

@iameru
Copy link
Author

iameru commented Mar 10, 2023

I just went and hardcoded the following line in the vim.vim file.
Now it worked.

  " let args.source = $FZF_DEFAULT_COMMAND.' | devicon-lookup'
  let args.source = 'rg --files --no-ignore --hidden --follow --glob "!.git/*" 2> /dev/null | devicon-lookup'

@coreyja
Copy link
Owner

coreyja commented Mar 10, 2023

@iameru Ahh glad you found a workaround!

I'll still try to take a look at this sometime soon

@iameru
Copy link
Author

iameru commented Mar 11, 2023

Ok, So I was trying again. Setting the ENV correctly via export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*" 2> /dev/null' actually worked.

so the loading in line 368 does its job properly.

in the readme.md it says:
... (runs $FZF_DEFAULT_COMMAND if defined) which is not really true. (as it runs it regardless, there is no if)

Maybe there need to be a reminder - or drop the support for FZF_DEFAULT_COMMAND, as I was never aware until raising this issue that this exists and still don't know why I should set this myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants