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

Devicons broken after last update #260

Closed
krims0n32 opened this issue Dec 15, 2021 · 8 comments
Closed

Devicons broken after last update #260

krims0n32 opened this issue Dec 15, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@krims0n32
Copy link

krims0n32 commented Dec 15, 2021

Hi, thank you for writing and releasing this plugin!

I have a small issue since the last update, all the devicons show the default (document) icon instead of filetype specific icon. This is since the last fzf-lua update you pushed. They work fine in NvimTree and bufferline.

image

@ibhagwan
Copy link
Owner

ibhagwan commented Dec 15, 2021

It's most likely related to the multiprocess performance enhancement, let's do two things:

First, disable multiprocess and see if it will work again (most likely will):

-- it's only enabled for grep/files
-- add 'multiprocess=false' under both
require'fzf-lua'.setup {
  files = {
    multiprocess      = false,
  },
  grep = {
    multiprocess      = false,
  },
}

It would be much appreciated if we can debug this further and see why this fails.

If you set multiprocess=true,debug=true fzf-lua will print the neovim external command to :messages, can you please post it here so we can try and figure out why devicons fail to load when running externally.

-- it's only enabled for grep/files
-- add 'multiprocess=false' under both
require'fzf-lua'.setup {
  files = {
    multiprocess      = true,
    debug             = true,
  },
  grep = {
    multiprocess      = true,
    debug             = true,
  },
}

Note that you don't have to do this via the setup() function, you can also send debug or multiprocess directly when calling the provider:

:lua require'fzf-lua'.files({ debug=true,multiprocess=true })

debug=true will then print a command similar to the below in :messages (which if run in the shell executes cmd=...):

'nvim' -n --headless --clean --cmd 'lua loadfile([[/home/bhagwan/.local/share/nvim/site/pack/packer/opt/fzf-lua/lua/fzf-lua/libuv.lua]])().spawn_stdio({debug=true,cmd=[[fd --color=never --type f --hidden --follow --exclude .git]],git_icons=false,file_icons=true,color_icons=true},[[_G._devicons_path='\''/home/bhagwan/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons/lua/nvim-web-devicons.lua'\''; _G._fzf_lua_server='\''/tmp/nvimEGl93J/1'\''; return require("make_entry").file]],[[return require("make_entry").preprocess]])'

You can then take what's specified in _G._devicons_path run this to see why it fails:

:lua print(loadfile("/home/bhagwan/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons/lua/nvim-web-devicons.
lua"))
-- If successfull should return a function:
function: 0x4050de18
-- or an error message:
:lua print(loadfile("/inaccessible/folder"))
nil cannot open /inaccessible/folder: No such file or directory

@ibhagwan ibhagwan added the bug Something isn't working label Dec 15, 2021
@krims0n32
Copy link
Author

krims0n32 commented Dec 15, 2021

Hi! Correct, it works without multiprocessing enabled.

It seems _G._devicons_path is not defined in the command though. Any idea? I'm using Plug and load 'kyazdani42/nvim-web-devicons' after all my other plugins, though putting it at the top has the same result.

'vi' -n --headless --clean --cmd 'lua loadfile([[/home/js/.local/share/nvim/plugged/fzf-lua//lua/fzf-lua/libuv.lua]])().spawn_stdio({debug=true,cmd=[[fd --color never --type f
 --hidden --follow --exclude .git --exclude node_modules --exclude '\''*.svg'\'' --exclude '\''*.pyc'\'' --exclude '\''*.ttf'\'' --exclude '\''*.woff'\'' --exclude '\''*.jpg'\
'' --exclude '\''*.png'\'' --exclude '\''*.gif'\'' --exclude '\''*.mp4'\'']],git_icons=true,file_icons=true,color_icons=true},[[_G._fzf_lua_server='\''/tmp/nvimRFW9In/1'\''; r
eturn require("make_entry").file]],[[return require("make_entry").preprocess]])

vi is an alias to nivm.

@ibhagwan
Copy link
Owner

We found the issue. that was my second suspicion, the plug-in couldn’t detect devicons in the runtime, perhaps because you’re using vim plug and I use packer they appear differently.

Can you post the result of this command:

:lua _G.dump(vim.api.nvim_list_runtime_paths())

@ibhagwan
Copy link
Owner

Actually forget it I have an idea how to extract the path better, will have a solution in 15 mins :)

@ibhagwan
Copy link
Owner

Took a bit longer than I thought but my initial idea was close, should be working now :-)

Lmk?

@krims0n32
Copy link
Author

Fixed. Thanks!

@ibhagwan
Copy link
Owner

If you get a chance and have a large code base try the new multiprocess option on it? performance should be stellar, feel free to report back in #248 :-)

@krims0n32
Copy link
Author

krims0n32 commented Dec 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants