mirror of
https://github.com/akinsho/toggleterm.nvim
synced 2024-09-16 21:34:03 +02:00
feat: support the CR for nushell (#561)
This commit is contained in:
parent
193786e037
commit
72d2aa290a
1 changed files with 9 additions and 1 deletions
|
@ -27,6 +27,8 @@ local function is_cmd(shell) return shell:find("cmd") end
|
|||
|
||||
local function is_pwsh(shell) return shell:find("pwsh") or shell:find("powershell") end
|
||||
|
||||
local function is_nushell(shell) return shell:find("nu") end
|
||||
|
||||
local function get_command_sep() return is_windows and is_cmd(vim.o.shell) and "&" or ";" end
|
||||
|
||||
local function get_comment_sep() return is_windows and is_cmd(vim.o.shell) and "::" or "#" end
|
||||
|
@ -34,7 +36,13 @@ local function get_comment_sep() return is_windows and is_cmd(vim.o.shell) and "
|
|||
local function get_newline_chr()
|
||||
local shell = config.get("shell")
|
||||
if type(shell) == "function" then shell = shell() end
|
||||
return is_windows and (is_pwsh(shell) and "\r" or "\r\n") or "\n"
|
||||
if is_windows then
|
||||
return is_pwsh(shell) and "\r" or "\r\n"
|
||||
elseif is_nushell(shell) then
|
||||
return "\r"
|
||||
else
|
||||
return "\n"
|
||||
end
|
||||
end
|
||||
|
||||
---@alias Mode "n" | "i" | "?"
|
||||
|
|
Loading…
Reference in a new issue