diff --git a/lua/fzf-lua/libuv.lua b/lua/fzf-lua/libuv.lua index 3db2e2e9..9938498f 100644 --- a/lua/fzf-lua/libuv.lua +++ b/lua/fzf-lua/libuv.lua @@ -708,7 +708,7 @@ M.wrap_spawn_stdio = function(opts, fn_transform, fn_preprocess) _is_win and [[set VIMRUNTIME=%s& ]] or "VIMRUNTIME=%s ", _is_win and vim.fs.normalize(vim.env.VIMRUNTIME) or M.shellescape(vim.env.VIMRUNTIME) ) - local lua_cmd = ("lua loadfile([[%s]])().spawn_stdio(%s,%s,%s)") + local lua_cmd = ("lua vim.g.did_load_filetypes=1; loadfile([[%s]])().spawn_stdio(%s,%s,%s)") :format( _is_win and vim.fs.normalize(__FILE__) or __FILE__, opts, fn_transform, fn_preprocess diff --git a/lua/fzf-lua/shell.lua b/lua/fzf-lua/shell.lua index d495b7c7..521c23ac 100644 --- a/lua/fzf-lua/shell.lua +++ b/lua/fzf-lua/shell.lua @@ -100,7 +100,7 @@ function M.raw_async_action(fn, fzf_field_expression, debug) local action_cmd = ("%s%s -n --headless --clean --cmd %s -- %s"):format( nvim_runtime, libuv.shellescape(path.normalize(nvim_bin)), - libuv.shellescape(("lua loadfile([[%s]])().rpc_nvim_exec_lua({%s})") + libuv.shellescape(("lua vim.g.did_load_filetypes=1; loadfile([[%s]])().rpc_nvim_exec_lua({%s})") :format(path.join { vim.g.fzf_lua_directory, "shell_helper.lua" }, call_args)), fzf_field_expression) diff --git a/scripts/headless_fd.sh b/scripts/headless_fd.sh index dc9ad621..9505d260 100755 --- a/scripts/headless_fd.sh +++ b/scripts/headless_fd.sh @@ -130,7 +130,7 @@ if [ $# -gt 0 ]; then fi VIMRUNTIME=/usr/share/nvim/runtime \ -/usr/bin/nvim -n --headless --clean --cmd "lua loadfile( +/usr/bin/nvim -n --headless --clean --cmd "lua vim.g.did_load_filetypes=1; loadfile( [[${BASEDIR}/../lua/fzf-lua/libuv.lua]])().spawn_stdio( -- opts {