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

correct way to pcall telescope-fzf-native for optional usage in lazy #96

Open
matu3ba opened this issue Jan 28, 2023 · 2 comments
Open

Comments

@matu3ba
Copy link
Contributor

matu3ba commented Jan 28, 2023

AFAIk lazy requires manual calls of :Lazy build and more over I'd like to have a general solution for optional plugin installations.

So far I tried:

-- pcall on telescope extension does not work:
-- local ok_fzf, _ = pcall(require, 'fzf-native')
-- local ok_fzf, _ = pcall(require, 'fzf_lib')
-- local ok_fzf = pcall(telescope.load_extension, 'fzf_lib')
-- assert(ok_fzf)
telescope.load_extension('fzf')

and I have seen exactly 1 instance (which also did not work) of

pcall(telescope.load_extension, 'fzf')

Note, lazy plugin usage is

{ "nvim-telescope/telescope-fzf-native.nvim", build = "make", lazy = false }, -- 1.65x speed of fzf

and then :Lazy build telescope-fzf-native

Suggestions welcome.

@swy7ch
Copy link

swy7ch commented Jan 29, 2023

I was messing with lazy, coming from packer... And spent the last 20 minutes figuring out why it wouldn't build. I'm very interested in the reason, and the solution for optional installations.

Anyhow, thanks for the workaround :)

@swy7ch
Copy link

swy7ch commented Feb 3, 2023

Alright I finally took the time to figure it out. I did have to search for it a bit on https://github.com/folke/lazy.nvim as I suspected it was more an issue with lazy than this extension...

And it -- kind of -- is. As you can read here [0], "lazy would not automatically build again if the plugin is already installed or not updated". In my case, I had the build command written as run when starting off the first time (coming from packer), which prevented the build from happening.

It's a hard thing to debug, but I wiped my lazy directory in ~/.local/share/nvim/lazy to start off fresh and it seems to build correctly. Hope this helps ! :)

[0] folke/lazy.nvim#119 (comment)

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