Skip to content

Commit 8aa4848

Browse files
committed
wip
1 parent 01c656a commit 8aa4848

File tree

1 file changed

+6
-4
lines changed
  • lua/codecompanion/interactions/chat/tools/builtin/insert_edit_into_file

1 file changed

+6
-4
lines changed

lua/codecompanion/interactions/chat/tools/builtin/insert_edit_into_file/init.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -904,13 +904,15 @@ local function edit_buffer(bufnr, chat_bufnr, action, output_handler, opts)
904904
ui_utils.scroll_to_line(bufnr, start_line)
905905
end
906906

907+
local success = success_response(fmt("Edited `%s` buffer%s", display_name, extract_explanation(action)))
908+
907909
if approvals:is_approved(chat_bufnr, { tool_name = "insert_edit_into_file" }) then
908910
api.nvim_buf_call(bufnr, function()
909911
vim.cmd("silent write")
910912
end)
911-
end
912913

913-
local success = success_response(fmt("Edited `%s` buffer%s", display_name, extract_explanation(action)))
914+
return output_handler(success)
915+
end
914916

915917
if should_diff and opts.require_confirmation_after then
916918
return handle_user_decision({
@@ -922,9 +924,9 @@ local function edit_buffer(bufnr, chat_bufnr, action, output_handler, opts)
922924
success_response = success,
923925
output_handler = output_handler,
924926
})
925-
else
926-
return output_handler(success)
927927
end
928+
929+
return output_handler(success)
928930
end
929931

930932
---@class CodeCompanion.Tool.EditFile: CodeCompanion.Tools.Tool

0 commit comments

Comments
 (0)