diff --git a/lua/chatgpt_nvim/ui.lua b/lua/chatgpt_nvim/ui.lua index c4f645e..959aada 100644 --- a/lua/chatgpt_nvim/ui.lua +++ b/lua/chatgpt_nvim/ui.lua @@ -19,7 +19,8 @@ end function M.debug_log(msg) if conf.improved_debug and debug_bufnr then - vim.api.nvim_buf_set_lines(debug_bufnr, -1, -1, false, { msg }) + local lines = vim.split(msg, "\n") + vim.api.nvim_buf_set_lines(debug_bufnr, -1, -1, false, lines) else if conf.debug then vim.api.nvim_out_write("[chatgpt_nvim:debug] " .. msg .. "\n") @@ -112,4 +113,4 @@ function M.chunkify(text, estimate_tokens_fn, token_limit) return chunks end -return M \ No newline at end of file +return M