vimPlugins.aider-nvim: fix patch
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
fetchpatch,
|
||||
fetchurl,
|
||||
neovimUtils,
|
||||
replaceVars,
|
||||
substituteAll,
|
||||
# Language dependencies
|
||||
fetchYarnDeps,
|
||||
@@ -2593,13 +2594,9 @@ in
|
||||
};
|
||||
|
||||
aider-nvim = super.aider-nvim.overrideAttrs {
|
||||
patches = [ ./patches/aider.nvim/fix-paths.patch ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace lua/aider.lua --replace-fail '@aider@' ${aider-chat}/bin/aider
|
||||
substituteInPlace lua/helpers.lua --replace-fail '@aider@' ${aider-chat}/bin/aider
|
||||
'';
|
||||
nvimRequireCheck = "aider";
|
||||
patches = [
|
||||
(replaceVars ./patches/aider-nvim/bin.patch { aider = lib.getExe' aider-chat "aider"; })
|
||||
];
|
||||
};
|
||||
|
||||
refactoring-nvim = super.refactoring-nvim.overrideAttrs {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
diff --git a/lua/aider.lua b/lua/aider.lua
|
||||
index 98b5071..589b06d 100644
|
||||
--- a/lua/aider.lua
|
||||
+++ b/lua/aider.lua
|
||||
@@ -61,9 +61,9 @@ function M.AiderOpen(args, window_type)
|
||||
log("Existing aider buffer found, opening in new window")
|
||||
helpers.open_buffer_in_new_window(window_type, M.aider_buf)
|
||||
else
|
||||
log("No existing aider buffer, creating new one")
|
||||
- local command = "aider " .. (args or "")
|
||||
+ local command = "@aider@ " .. (args or "")
|
||||
log("Opening window with type: " .. window_type)
|
||||
helpers.open_window(window_type)
|
||||
log("Adding buffers to command")
|
||||
command = helpers.add_buffers_to_command(command, is_valid_buffer)
|
||||
@@ -1,26 +0,0 @@
|
||||
diff --git a/lua/aider.lua b/lua/aider.lua
|
||||
index 38db0d1..d1ad6d5 100644
|
||||
--- a/lua/aider.lua
|
||||
+++ b/lua/aider.lua
|
||||
@@ -26,7 +26,7 @@ function M.AiderOpen(args, window_type)
|
||||
if M.aider_buf and vim.api.nvim_buf_is_valid(M.aider_buf) then
|
||||
helpers.open_buffer_in_new_window(window_type, M.aider_buf)
|
||||
else
|
||||
- command = 'aider ' .. (args or '')
|
||||
+ command = '@aider@ ' .. (args or '')
|
||||
helpers.open_window(window_type)
|
||||
command = helpers.add_buffers_to_command(command)
|
||||
M.aider_job_id = vim.fn.termopen(command, {on_exit = OnExit})
|
||||
diff --git a/lua/helpers.lua b/lua/helpers.lua
|
||||
index 152182b..aa21584 100644
|
||||
--- a/lua/helpers.lua
|
||||
+++ b/lua/helpers.lua
|
||||
@@ -63,7 +63,7 @@ end
|
||||
|
||||
local function build_background_command(args, prompt)
|
||||
prompt = prompt or "Complete as many todo items as you can and remove the comment for any item you complete."
|
||||
- local command = 'aider --msg "' .. prompt .. '" ' .. (args or '')
|
||||
+ local command = '@aider@ --msg "' .. prompt .. '" ' .. (args or '')
|
||||
command = add_buffers_to_command(command)
|
||||
return command
|
||||
end
|
||||
Reference in New Issue
Block a user