fix: add function close_existing_buffer_by_name back
This commit is contained in:
@@ -54,6 +54,16 @@ local function read_file(path)
|
||||
return data
|
||||
end
|
||||
|
||||
-- Added function to close existing buffers matching a name pattern.
|
||||
local function close_existing_buffer_by_name(name_pattern)
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
local buf_name = vim.api.nvim_buf_get_name(buf)
|
||||
if buf_name:match(name_pattern) then
|
||||
vim.api.nvim_buf_delete(buf, {force = true})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- PROMPT CONSTRUCTION
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user