-
Notifications
You must be signed in to change notification settings - Fork 151
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
Previewer (builtin/cat/bat) errors #651
Comments
I'll fix this one, nobody really uses require("fzf-lua").setup({
previewers = {
cat = { cmd = "cat", args = "" }
}
}) As for the If so, you can set it in the meantime in your require('fzf-lua').setup({
winopts = {
preview = {
default = "bat_async",
},
},
}) |
Can you please update to the latest commit da1881a and test default Awaiting further responses from you so we can fix |
Further investigation regarding
❯ '</path/to/>/VimR.app/Contents/Resources/NvimView_NvimView.bundle/Contents/Resources/NvimServer' -n --headless --cmd 'lua print("test")'
zsh: segmentation fault -n --headless --cmd 'lua print("test") Vs a standard build: ❯ nvim -n --headless --cmd 'lua print("test\n"); os.exit(0)'
test I opened an issue upstream qvacua/vimr#1001, hopefully it gets fixed fast.
I'm assuming the latest commit fixes the issue with the
|
Thanks for a super quick response & update! Yeah, And as to VimR, I get the same Okay, to the last remaining issue.
And I'm not sure which file or directory the last error message is referring to, but |
No big difference TBH, with bat, fzf spawns the bat which then calls neovim to get the filename (stripped of icons, line, col, text), with
That’s because you’re trying to preview the debug mode line :) Would you be able to screen shot again while the cursor is on a file line (not the debug line)? |
I just realized that the preview works for the
|
As I suspect it’s probably just shell escaping woes due to the matching text which also gets sent to the bat command and confuses the shell, can you post the full text in the selected line from live grep where it fails (from the main fzf window, not the preview)? I’m suspecting some special characters in there the shell doesn’t like, I will test myself using text from |
I'm not sure if the content of the file matters here. I just created a simple |
Maybe it’s your home folder or system path that fails, can you I’m going to restore |
2d4e3af - this commit should "solve" the It's up to you if you want to continue troubleshooting this issue (which I suspect is OS path related), the only difference is that now in order to invoke the bug you'd need to set the previewer to If you're happy with how it works and don't feel inclined to try and figure this out it's ok as I plan to one day phase out the |
I just tried in |
vimr issue can be dirty fixed by change the NvimServer binary to nvim as headleass subprocess. diff --git a/lua/fzf-lua/libuv.lua b/lua/fzf-lua/libuv.lua
index ba1ba2c..7c5e7db 100644
--- a/lua/fzf-lua/libuv.lua
+++ b/lua/fzf-lua/libuv.lua
@@ -465,7 +465,8 @@ end
M.wrap_spawn_stdio = function(opts, fn_transform, fn_preprocess)
assert(opts and type(opts) == "string")
assert(not fn_transform or type(fn_transform) == "string")
- local nvim_bin = vim.v.progpath
+ -- local nvim_bin = vim.v.progpath
+ local nvim_bin = "nvim"
local call_args = opts
for _, fn in ipairs({ fn_transform, fn_preprocess }) do
if type(fn) == "string" then
diff --git a/lua/fzf-lua/shell.lua b/lua/fzf-lua/shell.lua
index dce9dc5..db26a2b 100644
--- a/lua/fzf-lua/shell.lua
+++ b/lua/fzf-lua/shell.lua
@@ -60,7 +60,8 @@ function M.raw_async_action(fn, fzf_field_expression, debug)
-- this is for windows WSL and AppImage users, their nvim path isn't just
-- 'nvim', it can be something else
- local nvim_bin = vim.v.progpath
+ -- local nvim_bin = vim.v.progpath
+ local nvim_bin = "nvim"
local call_args = ("fzf_lua_server=[[%s]], fnc_id=%d %s"):format(
vim.g.fzf_lua_server, id, debug and ", debug=true" or "") |
Ty @SolaWing, I thought about it and opted against it, you’re not guaranteed the user has neovim binary installed and even if it is might be some unknown version with other bugs and a hell to troubleshoot, perhaps ok as a hack for someone who really wants it to work. |
Thanks for this brilliant idea, @SolaWing ! I just overrode those two functions locally and it works very well. In fact, in my case, it was enough to override @ibhagwan I agree this is a hack fraught with danger. Hope VimR fixes the issue soon. Thanks for this great plugin! I'm happy that I can use it in both of my environments now. :) |
That's great @benyn and ty @SolaWing for bringing this to conclusion. I really dislike users having to use hacks to make things work and this seems imporant to you so I just puhsed a much easier fix (368b998) that you can apply that doesn't require any maintenance on your part. Set the You can also do it specifically just for neovim by adding this to yor config: vim.env.FZF_LUA_NVIM_BIN="nvim" And test to see if it worked with: :lua print(os.getenv("FZF_LUA_NVIM_BIN")) |
That works very well. Thanks for going above and beyond, @ibhagwan ! |
This might be an off topic question, but for |
Yes, it should work, I’m pretty sure this is related to the shell escaping stuff that also caused |
Argh. So that issue is more pervasive. Okay, I'll open a new issue. |
Info
nvim --version
: v0.8.3 (Terminal) / v0.8.2 (VimR)fzf --version
: 0.38.0mini.sh
fzf-lua configuration
Description
I tested FzfLua after seeing @ibhagwan 's Reddit post, it worked well, so I added it to my Neovim setup. For some reason, none of the three previewers work, neither in a GUI (VimR) nor in a terminal (Apple Terminal).
The
builtin
previewer works well in Terminal, but gives a blank screen in VimR.cat
gives the following error message, both in Terminal and VimR:bat
gives the following error message, both in Terminal and VimR:I've only tried
live_grep
,live_grep_native
, andhelp_tags
.live_grep
works in Terminal but fails to populate the list in VimR, hence mygrep
settings. (I got the idea fromlive_grep_native
source code.) Not sure if these are enough details to identify the cause. Happy to provide more details!The text was updated successfully, but these errors were encountered: