From eb37dc81d2bb855bc170d6afd0fb7078d0fbf53d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20F=2E=20Bortl=C3=ADk?= Date: Fri, 3 Oct 2025 15:38:29 +0200 Subject: [PATCH 1/2] fix: put attach_file markdown on new line With this change, the attach_file markdown is put on a new line below the cursor instead of replacing the current line. --- lua/gitlab/actions/miscellaneous.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/gitlab/actions/miscellaneous.lua b/lua/gitlab/actions/miscellaneous.lua index 368c198b..bd0b0fb0 100644 --- a/lua/gitlab/actions/miscellaneous.lua +++ b/lua/gitlab/actions/miscellaneous.lua @@ -27,9 +27,7 @@ M.attach_file = function() local body = { file_path = full_path, file_name = choice } job.run_job("/attachment", "POST", body, function(data) local markdown = data.markdown - local current_line = u.get_current_line_number() - local bufnr = vim.api.nvim_get_current_buf() - vim.api.nvim_buf_set_lines(bufnr, current_line - 1, current_line, false, { markdown }) + vim.api.nvim_put({markdown}, "l", true, false) end) end) end From de18165c0473dee40f7a0b07568fb59050d7c5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20F=2E=20Bortl=C3=ADk?= Date: Fri, 3 Oct 2025 15:45:36 +0200 Subject: [PATCH 2/2] style: apply stylua --- lua/gitlab/actions/miscellaneous.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/gitlab/actions/miscellaneous.lua b/lua/gitlab/actions/miscellaneous.lua index bd0b0fb0..1b0c5550 100644 --- a/lua/gitlab/actions/miscellaneous.lua +++ b/lua/gitlab/actions/miscellaneous.lua @@ -27,7 +27,7 @@ M.attach_file = function() local body = { file_path = full_path, file_name = choice } job.run_job("/attachment", "POST", body, function(data) local markdown = data.markdown - vim.api.nvim_put({markdown}, "l", true, false) + vim.api.nvim_put({ markdown }, "l", true, false) end) end) end