bug: AvanteEdit doesn't work
Describe the bug
Using Xubuntu 22.0, Neovim 0.10.4, and Lazy package manager. I tried with Avante 0.0.12, 0.0.18, 0.0.23.
When I select a visual range, and type :AvanteEdit, it doesn't work. Sometimes I get an error message "E481: No range allowed". Sometimes I get an error message "No visual selection found". Sometimes nothing happens. I try to invoke the command many times in a row. Something is broken.
To reproduce
- Select a range of text.
- Enter ":AvanteEdit"
Expected behavior
It works.
Installation method
Use lazy.nvim:
-- avante
--
-- Cursor-like ML / AI interface
--
-- https://github.com/yetone/avante.nvim
local lcl_opts = {
'yetone/avante.nvim',
-- event = "VeryLazy",
-- lazy = false,
version = false, -- always pull the latest change
-- version = "v0.0.12",
opts = {
-- provider = "gemini",
-- gemini = {
-- model = "gemini-2.5-pro-exp-03-25"
-- },
behaviour = {
auto_suggestion = false,
},
suggestion = {
debounce = 600,
throttle = 600,
},
hints = {
enabled = false,
},
},
build = "make",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional
"echasnovski/mini.pick", -- for file_selector provider mini.pick
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
"ibhagwan/fzf-lua", -- for file_selector provider fzf
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
"zbirenbaum/copilot.lua", -- for providers='copilot'
{
-- support for image pasting
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- required for Windows users
use_absolute_path = true,
},
},
},
-- {
-- -- Make sure to set this up properly if you have lazy=true
-- 'MeanderingProgrammer/render-markdown.nvim',
-- opts = {
-- file_types = { "markdown", "Avante" },
-- },
-- ft = { "markdown", "Avante" },
-- },
},
}
return lcl_opts
Environment
Neovim 0.10.4
Xubuntu 22.04
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
-- add any other plugins here
},
})
Hi, I am too after '<,'>AvanteEdit write code here I am receiving "E481: No Range Allowed". (Neovim 0.11.0 installed from nix on rockylinux).
:Verbose command AvanteEdit
Name Args Address Complete Definition
AvanteEdit * <Lua 510: /apps/home/cukrowsk/.local/share/nvim/lazy/avante.nvim/plugin/avante.lua:105>
avante: edit selected block
Last set from /apps/home/cukrowsk/.local/share/nvim/lazy/avante.nvim/plugin/avante.lua (run Nvim with -V1 for more details)
Address is empty.. ? https://github.com/yetone/avante.nvim/blob/main/plugin/avante.lua#L106
Hasn't worked for me for a long time. Just deletes the contents of wherever I ask it to edit something.
Hi, I confirm it works. Opens a window "Avante edit selected block" with pre-filled text that I typed after the command and <C-s>: submit. Thank you. (fyi now I am hitting I think this bug https://github.com/neovim/neovim/issues/33224 , but it is related to neovim 0.11, works fine on 0.10.4)
Confirm - seems to work now. THANK YOU @yetone
Hasn't worked for me for a long time. Just deletes the contents of wherever I ask it to edit something.
Same here. I too have issues while trying to edit. It just removes the selection. VIM v0.11.2