nvim-telescope / telescope-fzf-native.nvim

FZF sorter for telescope written in c
1.36k stars 45 forks source link

Telescope FZF wont run due to the attempt to call a nil value #55

Closed sdushantha closed 2 years ago

sdushantha commented 2 years ago

Hey,

I have installed telescope.nvim and telescope-fzf-native.nvim but running :Telescope fzf returns the following error:

E5108: Error executing lua ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:184: attempt to call a nil value                                                                                         
stack traceback:                                                                                                                                                                                                
        ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:184: in function 'run_command'                                                                                                              
        ...ck/packer/start/telescope.nvim/lua/telescope/command.lua:244: in function 'load_command'                                                                                                             
        [string ":lua"]:1: in main chunk 

Some info that may help debugging:

$ nvim --version
NVIM v0.6.1
Build type: Release
LuaJIT 2.0.5
Compiled by builduser

$ lua -v
Lua 5.4.4  Copyright (C) 1994-2022 Lua.org, PUC-Rio

$ uname -a
Linux unicorn 5.16.5-arch1-1 #1 SMP PREEMPT Tue, 01 Feb 2022 21:42:50 +0000 x86_64 GNU/Linux

Config for telescope.nvim: https://github.com/sdushantha/dotfiles/blob/master/nvim/.config/nvim/lua/plugins/configs/telescope.lua

Config showing installation of telescope.nvim and telescope-fzf-native.nvim: https://github.com/sdushantha/dotfiles/blob/master/nvim/.config/nvim/lua/plugins/init.lua#L75-L78

Any help is appreciated :)

Conni2461 commented 2 years ago

:Telescope fzf is not a command.

It replaces an internal function that handles the sorting. It should just work in Telescope find_files ...

sdushantha commented 2 years ago

Ah that makes sense, thank you @Conni2461. The reason why I thought :Telescope fzf was a command was because it showed up in the autocompeletion: image

But after running :Telescope find_files I did notice that it seemed to be very slow compared to the regular fzf. See the video below for comparison.

https://user-images.githubusercontent.com/27065646/154038532-c3041fac-6387-4cf2-bef7-e0a699fb5902.mp4

EDIT: Does this maybe have something to do with the disclaimer you have put in the README?

This projects implements fzf algorithm in c. So there might be differences in matching. I don't guarantee completeness.

Conni2461 commented 2 years ago

both are bugs in telescope. The first one is a bug regarding extensions that it isn't possible to only export internal functions.

Second one is a UI issue: https://github.com/nvim-telescope/telescope.nvim/issues/1423 with a PR that tries to rewrite our whole ui rendering here https://github.com/nvim-telescope/telescope.nvim/pull/1491

Also is it a fair comparison with fzf showing a total of 166 511 files and telescope 456 738? The raw performance of this implementation of fzf is slightly faster than the original implementation of fzf in go. But its also more lightweight with no utf8 case support: https://github.com/nvim-telescope/telescope-fzf-native.nvim/pull/32#issuecomment-895481112