diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-04-20 05:47:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-20 05:47:08 -0700 |
commit | fd085d90820149caecf213b299f19e46305043ee (patch) | |
tree | 35bbab36ece729a62e4f17cd19c9edd09f9f41f1 /runtime/lua/vim | |
parent | 0ea38c9a53dfcff17703ea22f701ed1cc5bbd7d3 (diff) | |
download | rneovim-fd085d90820149caecf213b299f19e46305043ee.tar.gz rneovim-fd085d90820149caecf213b299f19e46305043ee.tar.bz2 rneovim-fd085d90820149caecf213b299f19e46305043ee.zip |
fix(vim.ui.open): try wslview before explorer.exe #28424
Problem:
explorer.exe is unreliable on WSL.
Solution:
Try wslview before explorer.exe.
fix #28410
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/ui.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua index b6695734a3..e02acaf25c 100644 --- a/runtime/lua/vim/ui.lua +++ b/runtime/lua/vim/ui.lua @@ -149,12 +149,14 @@ 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: explorer.exe, xdg-open)' + return nil, 'vim.ui.open: no handler found (tried: wslview, explorer.exe, xdg-open)' end return vim.system(cmd, { text = true, detach = true }), nil |