Cmd is tranformed to string before pushed to term (#151)

* Cmd is tranformed to string before pushed to term

Float terminal command is tranformed to string using table.concat before
used. This allow us to use neovim buff option to unite quoting.

* Update term.lua

Co-authored-by: Ales Brelih <ales.brelih@3fs.si>
Co-authored-by: rayx <rayx.cn@gmail.com>
nvim_0.6.1
Aleš Brelih 2 years ago committed by GitHub
parent 84ac01df53
commit edda37cb5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,10 +48,16 @@ local term = function(opts)
if opts.autoclose == nil then if opts.autoclose == nil then
opts.autoclose = true opts.autoclose = true
end end
-- run in neovim shell
if type(opts.cmd) == "table" then
opts.cmd = table.concat(opts.cmd, " ")
end
utils.log(opts)
local buf, win, closer = guihua_term.floating_term(opts) local buf, win, closer = guihua_term.floating_term(opts)
api.nvim_command("setlocal nobuflisted") api.nvim_command("setlocal nobuflisted")
api.nvim_buf_set_var(cur_buf, "go_float_terminal_win", { buf, win }) api.nvim_buf_set_var(cur_buf, "go_float_terminal_win", { buf, win })
api.nvim_buf_set_var(cur_buf, "shellcmdflag", "shell-unquoting")
return buf, win, closer return buf, win, closer
end end

Loading…
Cancel
Save