From edda37cb5ed07ff5586972e8eada263b987140d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Brelih?= Date: Sat, 2 Jul 2022 04:33:20 +0200 Subject: [PATCH] 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 Co-authored-by: rayx --- lua/go/term.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/go/term.lua b/lua/go/term.lua index 72980d3..10509f9 100644 --- a/lua/go/term.lua +++ b/lua/go/term.lua @@ -48,10 +48,16 @@ local term = function(opts) if opts.autoclose == nil then opts.autoclose = true 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) 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, "shellcmdflag", "shell-unquoting") return buf, win, closer end