From 36edeecef376c85aa664568560819a3972b18e7a Mon Sep 17 00:00:00 2001 From: Harrison Cramer Date: Sat, 18 Jan 2025 10:23:28 -0500 Subject: [PATCH 1/2] added change --- lua/gitlab/server.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/gitlab/server.lua b/lua/gitlab/server.lua index 6e77c8ac..52690c76 100644 --- a/lua/gitlab/server.lua +++ b/lua/gitlab/server.lua @@ -26,7 +26,11 @@ M.start = function(callback) state.chosen_mr_iid = 0 -- Do not let this interfere with subsequent reviewer.open() calls local settings = vim.json.encode(go_server_settings) - local command = string.format("%s '%s'", state.settings.bin, settings) + if vim.fn.has("win32") then + settings = settings:gsub('"', '\\"') + end + + local command = string.format('"%s" "%s"', state.settings.bin, settings) local job_id = vim.fn.jobstart(command, { on_stdout = function(_, data) @@ -93,8 +97,8 @@ M.build = function(override) end local res = vim - .system({ "go", "build", "-o", bin_name }, { cwd = state.settings.root_path .. u.path_separator .. "cmd" }) - :wait() + .system({ "go", "build", "-o", bin_name }, { cwd = state.settings.root_path .. u.path_separator .. "cmd" }) + :wait() if res.code ~= 0 then u.notify(string.format("Failed to install with status code %d:\n%s", res.code, res.stderr), vim.log.levels.ERROR) From 43b750c41173e49e95fe01e5eb32ae8d18515bf5 Mon Sep 17 00:00:00 2001 From: Harrison Cramer Date: Sat, 18 Jan 2025 10:26:07 -0500 Subject: [PATCH 2/2] formatting --- lua/gitlab/server.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/gitlab/server.lua b/lua/gitlab/server.lua index 52690c76..094100a1 100644 --- a/lua/gitlab/server.lua +++ b/lua/gitlab/server.lua @@ -97,8 +97,8 @@ M.build = function(override) end local res = vim - .system({ "go", "build", "-o", bin_name }, { cwd = state.settings.root_path .. u.path_separator .. "cmd" }) - :wait() + .system({ "go", "build", "-o", bin_name }, { cwd = state.settings.root_path .. u.path_separator .. "cmd" }) + :wait() if res.code ~= 0 then u.notify(string.format("Failed to install with status code %d:\n%s", res.code, res.stderr), vim.log.levels.ERROR)