aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/ui.lua
diff options
context:
space:
mode:
authorVu Nhat Chuong <ronnyvu321@gmail.com>2024-02-21 00:14:50 +0700
committerGitHub <noreply@github.com>2024-02-20 09:14:50 -0800
commit5e4a5f1aaa15be3bc17c5e96040fd71196993937 (patch)
treea416bc06e865e4ed387828f4f3dabd8166bd7053 /runtime/lua/vim/ui.lua
parenteb1e8c12e2c5ad172f2fe54cb96bf31602b16c3d (diff)
downloadrneovim-5e4a5f1aaa15be3bc17c5e96040fd71196993937.tar.gz
rneovim-5e4a5f1aaa15be3bc17c5e96040fd71196993937.tar.bz2
rneovim-5e4a5f1aaa15be3bc17c5e96040fd71196993937.zip
fix(vim.ui.open): use explorer.exe instead of wslview #26947
Problem: `vim.ui.open` uses `wslview`, which is slow and require a package from external PPA: https://wslutiliti.es/wslu/install.html#ubuntu Solution: Use `explorer.exe` instead. WSL supports it by default: https://learn.microsoft.com/en-us/windows/wsl/filesystems#view-your-current-directory-in-windows-file-explorer
Diffstat (limited to 'runtime/lua/vim/ui.lua')
-rw-r--r--runtime/lua/vim/ui.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua
index 25ced18daf..157b1461c3 100644
--- a/runtime/lua/vim/ui.lua
+++ b/runtime/lua/vim/ui.lua
@@ -143,12 +143,12 @@ function M.open(path)
else
return nil, 'vim.ui.open: rundll32 not found'
end
- elseif vim.fn.executable('wslview') == 1 then
- cmd = { 'wslview', path }
+ elseif vim.fn.executable('explorer.exe') == 1 then
+ cmd = { 'explorer.exe', path }
elseif vim.fn.executable('xdg-open') == 1 then
cmd = { 'xdg-open', path }
else
- return nil, 'vim.ui.open: no handler found (tried: wslview, xdg-open)'
+ return nil, 'vim.ui.open: no handler found (tried: explorer.exe, xdg-open)'
end
local rv = vim.system(cmd, { text = true, detach = true }):wait()