b0o / incline.nvim

🎈 Floating statuslines for Neovim, winbar alternative
MIT License
759 stars 14 forks source link

Highlight group not found error #39

Closed TxHawks closed 1 year ago

TxHawks commented 1 year ago

I am getting an highlight group not found: InclineNormal error after installing incline.nvim with the following config:

local colors = require("kanagawa.colors").setup().theme
require("incline").setup({
  highlight = {
    groups = {
      InclineNormal = {
        guibg = colors.sumilink0,
        guifg = colors.peachRed,
      },
      InclineNormalNC = {
        guibg = colors.sumilink0,
        guibg = colors.sumiInk4,
      },
    },
  },
  window = { margin = { vertical = 0, horizontal = 1 } },
  render = function(props)
    local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t")
    local icon, color = require("nvim-web-devicons").get_icon_color(filename)
    return { { icon, guifg = color }, { " " }, { filename } }
  end,
})

It all works fine if I remove the content of groups (i.e, set it to groups = {}.

This is the full error message:

...l/share/nvim/lazy/incline.nvim/lua/incline/highlight.lua:38: nvim_exec()..BufReadPre Autocommands for "*"..script nvim_exec() called at BufReadPre Autocommands for "*":0: Vim(highlight):E411: highlight group not found: InclineNormal

# stacktrace:
  - /incline.nvim/lua/incline/highlight.lua:38 _in_ **register**
  - /incline.nvim/lua/incline/highlight.lua:67 _in_ **setup**
  - /incline.nvim/lua/incline/init.lua:12 _in_ **enable**
  - /incline.nvim/lua/incline/init.lua:31 _in_ **setup**
  - lua/plugins/incline.lua:7 _in_ **config**
  - /telescope.nvim/lua/telescope/actions/set.lua:168 _in_ **run_replace_or_original**
  - /telescope.nvim/lua/telescope/actions/mt.lua:65 _in_ **run_replace_or_original**
  - /telescope.nvim/lua/telescope/actions/mt.lua:65 _in_ **run_replace_or_original**
  - /telescope.nvim/lua/telescope/actions/mt.lua:65 _in_ **key_func**
  - /telescope.nvim/lua/telescope/mappings.lua:350 _in_ **execute_keymap**
  - lua/:1

Am I doing something wrong here?

TxHawks commented 1 year ago

My bad, it was a typo