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

Diff highlight colorscheme changes back to default after re-open neovim

Open aaronyicongfu opened this issue 11 months ago • 3 comments

Describe the bug

First of all, thanks for creating this amazing plugin! Have been using it for a couple of days and absolutely love it.

Only issue I'm experiencing now is the highlight color scheme is only appropriate at the first time neovim launches right after installing avante: image

If I close neovim and open it again, the color scheme is changed to default: image

To reproduce

To reproduce the issue, I need to adopt the provided template but change

require("lazy.minit").repro({

to

require("lazy").setup({ ...

Below is a step-by-step instruction to reproduce the issue. The complete repro.lua is attached later.

nvim --clean -u repro.lua
  1. Invoke AvanteAsk and let it generate some code, then apply the change using shift+a
  2. observe that the color scheme is right: image
  3. close nvim, open again using
nvim -u repro.lua
  1. Invoke AvanteAsk again, apply the same change using shift + a
  2. observe that the color scheme is changed back to default image

Expected behavior

No response

Installation method

Use lazy.nvim and the exact install code from README:

    {
      "yetone/avante.nvim",
      event = "VeryLazy",
      lazy = false,
      version = false, -- set this to "*" if you want to always pull the latest change, false to update on release
      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 = {
        "stevearc/dressing.nvim",
        "nvim-lua/plenary.nvim",
        "MunifTanjim/nui.nvim",
        --- The below dependencies are optional,
        "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
        "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" },
        },
      },
    }

Environment

nvim -v: NVIM v0.10.2 Build type: Release LuaJIT 2.1.1732813678

uname -a: Darwin lawn-128-61-18-129.lawn.gatech.edu 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000 arm64

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy").setup({
  spec = {
    -- add any other plugins here
    {
      "yetone/avante.nvim",
      event = "VeryLazy",
      lazy = false,
      version = false, -- set this to "*" if you want to always pull the latest change, false to update on release
      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 = {
        "stevearc/dressing.nvim",
        "nvim-lua/plenary.nvim",
        "MunifTanjim/nui.nvim",
        --- The below dependencies are optional,
        "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
        "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" },
        },
      },
    }
  },
})

aaronyicongfu avatar Jan 08 '25 17:01 aaronyicongfu

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 Mar 01 '25 02:03 github-actions[bot]

‌‌‌Does this issue still exist?

yetone avatar Mar 01 '25 17:03 yetone

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 Apr 01 '25 02:04 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Apr 07 '25 02:04 github-actions[bot]