Skip to content

Commit

Permalink
revert: restore AvanteBuild (fixes yetone#792) (yetone#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarnphm authored Nov 5, 2024
1 parent b6f7c19 commit 16e10c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/avante/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ H.keymaps = function()
vim.keymap.set("v", "<Plug>(AvanteEdit)", function() require("avante.api").edit() end, { noremap = true })
vim.keymap.set("n", "<Plug>(AvanteRefresh)", function() require("avante.api").refresh() end, { noremap = true })
vim.keymap.set("n", "<Plug>(AvanteFocus)", function() require("avante.api").focus() end, { noremap = true })
vim.keymap.set("n", "<Plug>(AvanteBuild)", function() require("avante.api").build() end, { noremap = true })
vim.keymap.set("n", "<Plug>(AvanteToggle)", function() M.toggle() end, { noremap = true })
vim.keymap.set("n", "<Plug>(AvanteToggleDebug)", function() M.toggle.debug() end)
vim.keymap.set("n", "<Plug>(AvanteToggleHint)", function() M.toggle.hint() end)
Expand Down
14 changes: 14 additions & 0 deletions plugin/avante.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ end, {
})
cmd("Chat", function() require("avante.api").ask({ ask = false }) end, { desc = "avante: chat with the codebase" })
cmd("Toggle", function() require("avante").toggle() end, { desc = "avante: toggle AI panel" })
cmd("Build", function(opts)
local args = {}
for _, arg in ipairs(opts.fargs) do
local key, value = arg:match("(%w+)=(%w+)")
if key and value then args[key] = value == "true" end
end
if args.source == nil then args.source = false end

require("avante.api").build(args)
end, {
desc = "avante: build dependencies",
nargs = "*",
complete = function(_, _, _) return { "source=true", "source=false" } end,
})
cmd(
"Edit",
function(opts) require("avante.api").edit(vim.trim(opts.args)) end,
Expand Down

0 comments on commit 16e10c5

Please sign in to comment.