Closed alexmozaidze closed 11 months ago
Hmm strange. The second command is only called if the first one fails, which uses git
.
Thanks @alexmozaidze I had the same problem on the new Apple M1 Max Macbook.
I set this in my init.vim:
let g:fuzzy_rootcmds = [ \ ["git", "rev-parse", "--show-toplevel"], \ ]
with the original being https://github.com/cloudhead/neovim-fuzzy/blob/0bef4e1a81c65fc05d31380dd74454bd67733837/plugin/neovim-fuzzy.vim#L34-L37
I didn't have hg or root installed.
This worked for me (in init.lua
): vim.cmd('let g:fuzzy_rootcmds = [ ["git", "rev-parse", "--show-toplevel"] ]')
This worked for me (in
init.lua
):vim.cmd('let g:fuzzy_rootcmds = [ ["git", "rev-parse", "--show-toplevel"] ]')
I'm also using vim with init.lua config file, and it has worked very well for me.
@cloudhead
If you perform :FuzzyOpen
outside a git repository, git rev-parse --show-toplevel
fails. After that, hg root
gets called. git rev-parse --show-toplevel
is run, returns an error and is handled properly, while hg root
cannot be run since hg
is does not exist and so system(cmd)
throws.
My guess is that the function should use executable(cmd)
([doc](https://vimdoc.sourceforge.net/htmldoc/eval.html#executable())) before calling system(cmd)
Hmm yeah, that makes sense!
Fixed in 16ee769bb459e8173a2ef9f515905c8f879ff7c6
I don't have hg installed, and whenever I try to fuzzy search it gives an error (every time), and after I hit enter it works fine. I found solution to the problem, that is to manually set
g:fuzzy_rootcmds
to only have the programs you have on the system (for me it's git).