fix: failed to rename buffer (#730)

This commit is contained in:
yetone
2024-10-16 23:57:40 +08:00
committed by GitHub
parent 9907f05fbf
commit a0d3845bf3
2 changed files with 13 additions and 8 deletions

View File

@@ -559,8 +559,7 @@ function Sidebar:apply(current_cursor)
vim.defer_fn(function()
for filepath, snippets in pairs(selected_snippets_map) do
local bufnr = Utils.get_opened_buffer(filepath)
if not bufnr then bufnr = Utils.create_new_buffer_with_file(filepath) end
local bufnr = Utils.get_or_create_buffer_with_filepath(filepath)
insert_conflict_contents(bufnr, snippets)
local winid = Utils.get_winid(bufnr)
if not winid then goto continue end