@@ -43,10 +43,9 @@ file boundaries (start/end), and complete file overwrites.
4343--]]
4444
4545local Path = require (" plenary.path" )
46-
47- local Approvals = require (" codecompanion.interactions.chat.tools.approvals" )
48- local Constants = require (" codecompanion.interactions.chat.tools.builtin.insert_edit_into_file.constants" )
46+ local approvals = require (" codecompanion.interactions.chat.tools.approvals" )
4947local config = require (" codecompanion.config" )
48+ local constants = require (" codecompanion.interactions.chat.tools.builtin.insert_edit_into_file.constants" )
5049local helpers = require (" codecompanion.interactions.chat.helpers" )
5150local match_selector = require (" codecompanion.interactions.chat.tools.builtin.insert_edit_into_file.match_selector" )
5251local strategies = require (" codecompanion.interactions.chat.tools.builtin.insert_edit_into_file.strategies" )
@@ -683,14 +682,14 @@ local function edit_file(action, chat_bufnr, output_handler, opts)
683682 end
684683 end
685684
686- if # current_content > Constants .LIMITS .FILE_SIZE_MAX then
685+ if # current_content > constants .LIMITS .FILE_SIZE_MAX then
687686 return output_handler (
688687 mk_response (
689688 " error" ,
690689 fmt (
691690 " Error: File too large (%d bytes). Maximum supported size is %d bytes." ,
692691 # current_content ,
693- Constants .LIMITS .FILE_SIZE_MAX
692+ constants .LIMITS .FILE_SIZE_MAX
694693 )
695694 )
696695 )
@@ -740,7 +739,7 @@ local function edit_file(action, chat_bufnr, output_handler, opts)
740739 end
741740
742741 -- If the tool has been approved then skip showing the diff
743- if Approvals :is_approved (chat_bufnr , { tool_name = " insert_edit_into_file" }) then
742+ if approvals :is_approved (chat_bufnr , { tool_name = " insert_edit_into_file" }) then
744743 return output_handler (
745744 mk_response (" success" , fmt (" Edited `%s` file%s" , action .filepath , extract_explanation (action )))
746745 )
@@ -861,7 +860,7 @@ local function edit_buffer(bufnr, chat_bufnr, action, output_handler, opts)
861860 local success_msg = fmt (" Edited `%s` buffer%s" , display_name , extract_explanation (action ))
862861
863862 -- If the tool has been approved then skip showing the diff
864- if Approvals :is_approved (chat_bufnr , { tool_name = " insert_edit_into_file" }) then
863+ if approvals :is_approved (chat_bufnr , { tool_name = " insert_edit_into_file" }) then
865864 api .nvim_buf_call (bufnr , function ()
866865 vim .cmd (" silent write" )
867866 end )
0 commit comments