Closed tobiwild closed 10 months ago
Ty for the report @tobiwild, I’ll look into it.
@tobiwild, I can't seem to reproduce this, can you share some more pointers when this happens exactly?
hidden
state (press F4
)?<C-\><C-n>p
(or from clipboard using <C-\><C-n>"+p"
Can you also try to download fzf v0.39 binary and try the same with:
:lua require("fzf-lua").files({ fzf_bin = "/path/to/fzf-v0.39" })
I checked again and found that the FZF zero event and the shell execution seems to be the issue, disabling this zero event helps. I tested also with disabling the clear_preview_buf
call:
diff --git a/lua/fzf-lua/previewer/builtin.lua b/lua/fzf-lua/previewer/builtin.lua
index 9a4f558..f901db9 100644
--- a/lua/fzf-lua/previewer/builtin.lua
+++ b/lua/fzf-lua/previewer/builtin.lua
@@ -292,11 +292,14 @@ function Previewer.base:cmdline(_)
return act
end
+local calls = 0
function Previewer.base:zero(_)
local act = string.format("execute-silent(%s)",
shell.raw_action(function(_, _, _)
- self:clear_preview_buf(true)
- self.last_entry = nil
+ calls = calls + 1
+ vim.notify("Previewer Zero Call " .. calls)
+ -- self:clear_preview_buf(true)
+ -- self.last_entry = nil
end, "", self.opts.debug))
return act
end
The issue remains:
https://github.com/ibhagwan/fzf-lua/assets/891533/5986bcd1-ba01-4ccc-9e60-15415e1f6c26
Typing the string fast works fine, pasting via <C-\><C-n>p
has the same issue.
But I now switched to bat
which I'm also fine with.
I checked again and found that the FZF zero event
The zero even is used to clear the previewer when fuzzy matching yields no results, it was only introduced since fzf 0.40 that’s why I asked to try with 0.39 as I suspected this might be it based on the commit you linked.
I tested also with disabling the
clear_preview_buf
call:
from the video it seems your notification is being called and you can exit fzf-lua, what do you exactly mean by fzf-lua freezes”?
After analyzing your screencast this seems to be working as expected, typing Previewer
simply yields no results (note the 0/63
in the info line I.e. no matches), can you try slowly deleting characters with backspace and see when you start getting results again?
Losing due to inactivity, feel free to reopen if this is still an issue @tobiwild.
I'm having the same issue when pasting in files
search:
Here's an example of pasting fzf_lua_history
string having no results:
@ibhagwan Would it be possible to look into this issue? I'll try switching to a different previewer than the bulitin and see if this helps.
Can you also try to download fzf v0.39 binary and try the same with:
:lua require("fzf-lua").files({ fzf_bin = "/path/to/fzf-v0.39" })
@somnam, what is your fzf version? are you also on MacOS? Can you try with fzf version 0.39 as mentioned above and let me know if the issues exists with 0.39?
@somnam, what is your fzf version? are you also on MacOS? Can you try with fzf version 0.39 as mentioned above and let me know if the issues exists with 0.39?
Yep, I'm on MacOS too, but using bash & wezterm. I was using the latest fzf version 0.44.1 installed from git repo with --bin
option. After switching back to 0.39 it looks like the issue has gone away. The problem seems to be linked with the zero event (0.40.0 has the same problem for me). Is there some additional info / debug I could provide?
@somnam, what is your fzf version? are you also on MacOS? Can you try with fzf version 0.39 as mentioned above and let me know if the issues exists with 0.39?
Yep, I'm on MacOS too, but using bash & wezterm. I was using the latest fzf version 0.44.1 installed from git repo with
--bin
option. After switching back to 0.39 it looks like the issue has gone away. The problem seems to be linked with the zero event (0.40.0 has the same problem for me). Is there some additional info / debug I could provide?
No need to provide any additional info, I was able to reproduce this, not sure what causes the freeze yet but it seams to stem from consecutive calls to the zero event, I have an idea to solve this with a singleton shell command, I’ll test it tomorrow.
@tobiwild, @somnam, turns out this is an issue with fzf, opened an issue upstream: https://github.com/junegunn/fzf/issues/3516
Edit: https://github.com/ibhagwan/fzf-lua/commit/1fa0252f760cec028709e02f7473a5156d1ad040 - added debounce mechanism to the zero event in hope this will alleviate the issue a bit, we'll still have to wait for the upstream for a proper fix.
FYI, this is solved at the upstrem's HEAD, waiting for a new release to close this issue.
Info
nvim --version
: NVIM v0.10.0-dev-5383+g0818d6552-Homebrew Build type: Release LuaJIT 2.1.1696795921 Run "nvim -V1 -v" for more infofzf --version
: 0.43.0 (brew)mini.sh
Description
Reproduce:
sh -c "$(curl -s https://raw.githubusercontent.com/ibhagwan/fzf-lua/main/scripts/mini.sh)"
C-p
to open files prompt<cmd>v
<c-\\><c-n>
I checked with
git bisect
and found that 32821ea80674c053d3c407034625925cb20dd101 introduced this behaviour, and indeed when I change the previewer for files tobat
the issue is gone.