From 273d5e9ac5cc84c72de856559b18e28050cca86f Mon Sep 17 00:00:00 2001 From: Adam Wolski Date: Wed, 15 Mar 2023 09:18:52 +0100 Subject: fix(windows): treat any non-cmd shell as powershell like in selector --- lua/nvim-treesitter/shell_command_selectors.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lua') 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) -- cgit v1.2.3-70-g09d2