From 3c7a6656b88cff3c6525c161463cfa5c075e2ca4 Mon Sep 17 00:00:00 2001 From: Aaron Weisberg Date: Wed, 20 Mar 2024 20:31:29 -0700 Subject: [PATCH] feat(select): prepend line numbers to buffer lines This change modifies the 'buffer' function in the 'select.lua' file to prepend line numbers to each line in the buffer. This will provide a clearer context when viewing the buffer content. --- lua/CopilotChat/select.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/CopilotChat/select.lua b/lua/CopilotChat/select.lua index 65a9fb84..d4ed4402 100644 --- a/lua/CopilotChat/select.lua +++ b/lua/CopilotChat/select.lua @@ -74,6 +74,11 @@ function M.buffer(source) return nil end + -- Prepend line numbers to each line + for i, line in ipairs(lines) do + lines[i] = string.format('%d: %s', i, line) + end + return { lines = table.concat(lines, '\n'), start_row = 1,