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

bug: Inconsistent separator highlights

Open Alienover opened this issue 9 months ago • 1 comments

Describe the bug

Image

After https://github.com/yetone/avante.nvim/commit/b837274e0fa0fdf13885f533883edeeeb929daee, the sidebar's borders are all with bright color, which definitely doesn't look like the border for other panes.

# my theme is `catppuccin-mocha` and this is the default value of the `NormalFloat`

NormalFloat    xxx guifg=#cdd6f4

Wondering why we changed the hl value from FloatBorder to NormalFloat. I expect that the highlight NormalFloat should be more for the text in the floating windows.

To reproduce

No response

Expected behavior

The sidebar's border should look the same as those for other panes.

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-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  },
}

Environment

NVIM v0.11.0 Build type: Release LuaJIT 2.1.1741730670

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

Alienover avatar Apr 02 '25 05:04 Alienover

My current solution is to link the highlight AvanteSidebarWinSeparator to AvanteSidebarWinHorizontalSeparator

return {
  "yetone/avante.nvim",

  -- other lazy plugin specs

   config = function(_, opts)
  	require("avante").setup(opts)
  
  	-- INFO: fix the border highlights
  	vim.api.nvim_set_hl(0, "AvanteSidebarWinSeparator", { link = "AvanteSidebarWinHorizontalSeparator" })
  end
}

Alienover avatar Apr 06 '25 21:04 Alienover

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 May 07 '25 02:05 github-actions[bot]

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

github-actions[bot] avatar May 12 '25 02:05 github-actions[bot]

Not stale, but @Alienover's solution works for me

Cretezy avatar May 21 '25 05:05 Cretezy

Additionally, I'm getting some weird separator issues with avante.

Notice that the bottom left separator character of the top left buffer is not highlighted correctly. Additionally the bottom buffer's right separator is not also missing. This is with no custom highlight groups. Image

When I add use tokyo-night with WinSeparator = { fg = "#b1b7d3", bg = "NONE", bold = true }, I also get weird behavior (only after opening Avante):

Image

Using the vim.api.nvim_set_hl(0, "AvanteSidebarWinSeparator", { link = "AvanteSidebarWinHorizontalSeparator" }) solution above fixes this, but how there's 2 separators

Image

Changing the color of AvanteSidebarWinHorizontalSeparator shows this weirdness:

Image

Cretezy avatar May 21 '25 06:05 Cretezy