Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: AerialLine should take precedence over other highlights #329

Closed
jemag opened this issue Nov 19, 2023 · 1 comment
Closed

bug: AerialLine should take precedence over other highlights #329

jemag opened this issue Nov 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jemag
Copy link

jemag commented Nov 19, 2023

Neovim version (nvim -v)

NVIM v0.10.0-dev-cdc8bac

Operating system/version

Arch Linux 6.6.1-arch1-1

Output of :AerialInfo

Using minimal repro.lua on go file:
Aerial Info

Filetype: go
Configured backends:
treesitter (supported) (attached)
lsp (not supported) [No LSP client found that supports symbols]
markdown (not supported) [Filetype is not markdown]
man (not supported) [Filetype is not man]
Show symbols: Class, Constructor, Enum, Function, Interface, Module, Method, Struct

Describe the bug

The highlight AerialLine does not seem to take precedence over other highlight groups. For example, AerialFunction foreground color will be used instead of the one defined by AerialLine

Steps To Reproduce

  1. Open example file with minimal config using nvim -u repro.lua main.go

  2. Notice that despite that AerialLine highlight defining black foreground, the color remains white:
    image
    image
    image
    image

  3. Notice that AerialFunction seems to take precedence over AerialLine foreground
    image

Expected Behavior

AerialLine highlight takes precedence

Minimal example file

package main

import "fmt"

func main() {
fmt.Println("hello world")
}

func other() {
}
func other1() {
}
func other2() {
}

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "Shatur95/neovim-ayu",
  {
    "nvim-treesitter/nvim-treesitter",
    config = function()
      require("nvim-treesitter.configs").setup({
        indent = {
          enable = false,
        },
        highlight = {
          enable = true, -- false will disable the whole extension
        },
        ensure_installed = {
          "go",
        }, -- one of "all", "language", or a list of languages
      })
    end,
  },
  {
    "stevearc/aerial.nvim",
    config = function()
      vim.g.mapleader = " "
      require("aerial").setup({
        layout = {
          min_width = 25,
        },
        on_attach = function(bufnr)
          -- Toggle the aerial window with <leader>a
          -- Jump forwards/backwards with '{' and '}'
          vim.api.nvim_buf_set_keymap(bufnr, "n", "{", "<cmd>AerialPrev<CR>", { desc = "Aerial prev" })
          vim.api.nvim_buf_set_keymap(bufnr, "n", "}", "<cmd>AerialNext<CR>", { desc = "Aerial prev" })
          -- Jump up the tree with '[[' or ']]'
          vim.api.nvim_buf_set_keymap(bufnr, "n", "[[", ":lua require('aerial').prev_up()<CR>", { desc = "Aerial prev up" })
          vim.api.nvim_buf_set_keymap(bufnr, "n", "]]", ":lua require('aerial').next_up()<CR>", { desc = "Aerial next up" })
        end,
      })
      vim.keymap.set("n", "<leader>ta", "<cmd>AerialToggle!<CR>", { desc = "Toggle aerial" })
      vim.api.nvim_create_autocmd({ "ColorScheme" }, {
        pattern = "*",
        callback = function()
          -- vim.api.nvim_set_hl(0, "AerialFunction", { link = "Normal" })
          vim.api.nvim_set_hl(0, "AerialLine", { fg = "black", bg = "#D4BFFF", force = true })
        end,
      })
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("ayu-mirage")

Additional context

No response

@jemag jemag added the bug Something isn't working label Nov 19, 2023
@stevearc
Copy link
Owner

fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants