diff options
| author | Adam Wolski <adam@wolski.email> | 2023-03-15 09:18:52 +0100 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-16 04:23:14 -0400 |
| commit | 273d5e9ac5cc84c72de856559b18e28050cca86f (patch) | |
| tree | aea8f3c5c4b3a66614aabb4c4d481dccc2da141d | |
| parent | fix(windows): fix invalid powershell separator during install (diff) | |
| download | nvim-treesitter-273d5e9ac5cc84c72de856559b18e28050cca86f.tar nvim-treesitter-273d5e9ac5cc84c72de856559b18e28050cca86f.tar.gz nvim-treesitter-273d5e9ac5cc84c72de856559b18e28050cca86f.tar.bz2 nvim-treesitter-273d5e9ac5cc84c72de856559b18e28050cca86f.tar.lz nvim-treesitter-273d5e9ac5cc84c72de856559b18e28050cca86f.tar.xz nvim-treesitter-273d5e9ac5cc84c72de856559b18e28050cca86f.tar.zst nvim-treesitter-273d5e9ac5cc84c72de856559b18e28050cca86f.zip | |
fix(windows): treat any non-cmd shell as powershell like in selector
| -rw-r--r-- | lua/nvim-treesitter/shell_command_selectors.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua index e90cb81c9..cf99a01d7 100644 --- a/lua/nvim-treesitter/shell_command_selectors.lua +++ b/lua/nvim-treesitter/shell_command_selectors.lua @@ -318,10 +318,10 @@ end ---@return string command function M.make_directory_change_for_command(dir, command) if fn.has "win32" == 1 then - if vim.o.shell == "powershell" or vim.o.shell == "pwsh" then - return string.format("pushd %s ; %s ; popd", cmdpath(dir), command) - else + if string.find(vim.o.shell, "cmd") ~= nil then return string.format("pushd %s & %s & popd", cmdpath(dir), command) + else + return string.format("pushd %s ; %s ; popd", cmdpath(dir), command) end else return string.format("cd %s;\n %s", dir, command) |
