Name the preview variable in WSLENV

WSL shares only the variables listed there with a Windows vim.exe, as
s:preview_cmd already does for MSWINHOME. Untested, no WSL here.
This commit is contained in:
Junegunn Choi
2026-09-28 00:49:38 +09:00
parent 63fb5c974f
commit 777e783382
+4 -1
View File
@@ -35,7 +35,10 @@ fi
# it cannot run a shell command or touch a file. ':sandbox' on its own only
# covers the command up to the first '|', hence 'sandbox execute' on a value
# passed through the environment, which keeps the whole address inside
CENTER="$(FZFVIM_EXCMD="${EXCMD}" "${VIMNAME}" -R -i NONE -u NONE -e -m -s "${FILE}" \
export FZFVIM_EXCMD="${EXCMD}"
# WSL shares only the variables named in WSLENV with a Windows vim.exe
export WSLENV="FZFVIM_EXCMD/w${WSLENV:+:${WSLENV}}"
CENTER="$("${VIMNAME}" -R -i NONE -u NONE -e -m -s "${FILE}" \
-c "set nomagic" \
-c 'silent sandbox execute $FZFVIM_EXCMD' \
-c 'let l=line(".") | new | put =l | print | qa!')" || exit