1+ local NVIM_BIN = os.getenv (" FZF_LUA_NVIM_BIN" ) or vim .v .progpath
2+ local NVIM_RUNTIME = os.getenv (" FZF_LUA_NVIM_RUNTIME" ) or os.getenv (" VIMRUNTIME" )
3+ if NVIM_RUNTIME then vim .env .VIMRUNTIME = NVIM_RUNTIME end
4+
15--- @diagnostic disable-next-line : deprecated
26local api , uv , fn = vim .api , vim .uv or vim .loop , vim .fn
37--- @module ' ffi' ?
@@ -124,7 +128,7 @@ return {
124128 if ffi and # entries == 1 then
125129 local lnum = entries [1 ].line > 0 and entries [1 ].line or nil
126130 local col = entries [1 ].col > 0 and entries [1 ].col or nil
127- posix_exec (fn . exepath ( " nvim " ) , entries [1 ].path ,
131+ posix_exec (NVIM_BIN , entries [1 ].path ,
128132 lnum and (" +" .. entries [1 ].line ) or nil ,
129133 col and (" +norm! %s|" ):format (col ) or nil )
130134 elseif ffi and # entries > 1 then
@@ -140,7 +144,7 @@ return {
140144 })
141145 end
142146 local qf_str = vim .inspect (qf_items ):gsub (" \n %s*" , " " )
143- posix_exec (fn . exepath ( " nvim " ) , " -c" , string.format (
147+ posix_exec (NVIM_BIN , " -c" , string.format (
144148 " lua vim.o.hidden=false; vim.fn.setqflist(%s); vim.cmd('cfirst | set hidden&')" ,
145149 qf_str ))
146150 end
@@ -173,7 +177,7 @@ return {
173177 vim .uv .kill (pid , vim .uv .constants .SIGTERM )
174178 end
175179 enable_stdio_inheritance ()
176- posix_exec (fn . exepath ( " nvim " ) , " --remote-ui" , " --server" , remote )
180+ posix_exec (NVIM_BIN , " --remote-ui" , " --server" , remote )
177181 end
178182 }
179183 }
0 commit comments