avante.nvim icon indicating copy to clipboard operation
avante.nvim copied to clipboard

bug: diff mappings don't get mapped and virtual text is confusing

Open litoj opened this issue 2 months ago • 2 comments

Describe the bug

When trying to accept all or accept just one change I was unable to do so by any other means then by pressing CR in the chat window to confirm the Accept button.

Even after trying to customize the mappings, the results are still the same. All in all, I found multiple weird behaviours:

  • insert doesn't create any mappings
  • str_replace creates the mappings for ours and theirs, but not all_theirs
  • insert shows the changes as virtual text that the user cannot click on making it impossible to confirm it using the theirs mapping (when loaded via prior use of str_replace
  • none of the virtual text goes away when I don't react to it and ask a new question or just avante: stop
  • for str_replace the original text becomes virtual and the incoming text becomes the one I can click on and gets highlighting. That is weird on it's own, especially considering the fact that with insert the incoming text stays as virtual as one would more likely expect
    • personal suggestion: make both texts real, but put the incoming text after the real/to-be-replaced block
  • even when I confirm (or reject) all diffs, the tool call in the chat window still shows the Accept... buttons that I have to click in the end anyway in order to let the agent continue in work. This is bad, because I cannot be sure, that accepting it will mean, that what I manually rejected will get overriden in the end etc. It also ruins the point of keyboard shortcuts to accept all

To reproduce

avante ask:

try to use the insert tool to insert a simple hello world at the end of the document

then say:

try to do the same, but using the str_replace tool

without interacting with the previous suggestion (you cannot interact with it in the target/modified buffer anyway)

Expected behavior

practically described in the definition of the problem

Installation method

Use lazy.nvim:

{
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  opts = {
    -- add any opts here
  },
  -- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
  build = "make",
  -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
  dependencies = {
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  },
}

Environment

nvim: 0.11.4 archlinux 1.0

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
  },
})

litoj avatar Oct 22 '25 11:10 litoj

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 23 '25 02:11 github-actions[bot]

This is still a major issue that prevents me from using avante fully

litoj avatar Nov 24 '25 12:11 litoj