From 44c825b99d58a8894599297ee485b92aa6cb0418 Mon Sep 17 00:00:00 2001 From: DarthMooMancer <107283522+DarthMooMancer@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:35:36 -0400 Subject: [PATCH] Allow for multiline strings when compiling --- lua/Polydev/c.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/Polydev/c.lua b/lua/Polydev/c.lua index 553eb72..debe309 100644 --- a/lua/Polydev/c.lua +++ b/lua/Polydev/c.lua @@ -245,7 +245,7 @@ function M.build() vim.api.nvim_buf_set_option(term_buf, "modifiable", true) local output = vim.fn.system(cmd) local success = vim.v.shell_error == 0 - vim.api.nvim_buf_set_lines(term_buf, 0, -1, false, { success and "Compilation successful!" or "Error during compilation:", output }) + vim.api.nvim_buf_set_lines(term_buf, 0, -1, false, vim.list_extend({ success and "Compilation successful!" or "Error during compilation:" }, vim.split(output, "\n", { trimempty = true }))) vim.api.nvim_buf_set_option(term_buf, "modifiable", false) end