loctvl842 / monokai-pro.nvim

Monokai Pro theme for Neovim written in Lua, with multiple filters: Pro, Classic, Machine, Octagon, Ristretto, Spectrum
MIT License
439 stars 41 forks source link

🐛 Invalid filter, expected "classic", "machine", "octagon", "pro", "ristretto" or "spectrum" #116

Open gorillamoe opened 6 months ago

gorillamoe commented 6 months ago

This is my setup

require("monokai-pro").setup({
  transparent_background = false,
  terminal_colors = true,
  devicons = true, -- highlight the icons of `nvim-web-devicons`
  styles = {
    comment = { italic = true },
    keyword = { italic = true }, -- any other keyword
    type = { italic = true }, -- (preferred) int, long, char, etc
    storageclass = { italic = true }, -- static, register, volatile, etc
    structure = { italic = true }, -- struct, union, enum, etc
    parameter = { italic = true }, -- parameter pass in function
    annotation = { italic = true },
    tag_attribute = { italic = true }, -- attribute of tag in reactjs
  },
  filter = "pro", -- classic | octagon | pro | machine | ristretto | spectrum
  -- Enable this will disable filter option
  day_night = {
    enable = false, -- turn off by default
    day_filter = "pro", -- classic | octagon | pro | machine | ristretto | spectrum
    night_filter = "spectrum", -- classic | octagon | pro | machine | ristretto | spectrum
  },
  inc_search = "background", -- underline | background
  background_clear = {
    -- "float_win",
    "toggleterm",
    "telescope",
    "which-key"
  },-- "float_win", "toggleterm", "telescope", "which-key", "renamer", "neo-tree"
  plugins = {
    bufferline = {
      underline_selected = false,
      underline_visible = false,
    },
    indent_blankline = {
      context_highlight = "default", -- default | pro
      context_start_underline = false,
    },
  },
  ---@param c Colorscheme
  override = function(c) end,
})

I get this message after updating this theme to v1.21.0:

Invalid filter, expected "classic", "machine", "octagon", "pro", "ristretto" or "spectrum"

This is new and never happened in the past.

I'm on

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377
gorillamoe commented 6 months ago

I git bisected it to v1.19.2. v1.19.1 works like a charm and v1.19.2 and upwards prints the log message.

gorillamoe commented 6 months ago

Seems to be related to the lualine config I have:

require('lualine').setup {
  options = {
    theme = 'monokai-pro'
  }
}

If I remove the options table, no message is printed.

kaykhan commented 3 months ago

Im also getting this issue, is there a fix?

gorillamoe commented 3 months ago

Im also getting this issue, is there a fix?

I'm not sure, I moved to a different colorscheme, so it may be that there is only the workaround posted by me :shrug:

stephanedemotte commented 1 month ago

Same here got Invalid filter

realth000 commented 1 month ago

Somehow the filter here is nil.

I'm using lazy.nvim as package manager and set monokai-pro.nvim to lazy fixes this issue.

By the way I don't have anything like require("monokai-pro").setup({ ... } ) in my config.

rcarmo commented 4 weeks ago

Getting the same error with latest version.

rcarmo commented 3 weeks ago

I fixed it by explicitly forcing the theme to load before lualine:

local lazyplugins = {
   {
        -- color scheme
        'loctvl842/monokai-pro.nvim',
        lazy = false,
        priority = 1000,
        dependencies = {'nvim-tree/nvim-web-devicons'},
        config = function()
            require('monokai-pro').setup({
                devicons = true,
                filter = "pro",
                background_clear = {"toggleterm", "telescope", "notify"}
            })
            vim.cmd([[colorscheme monokai-pro]])
        end
    }, {
        -- status line
        'nvim-lualine/lualine.nvim',
        dependencies = {'nvim-tree/nvim-web-devicons'},
        lazy = false,
        config = function()
            require('lualine').setup({options = {theme = 'monokai-pro'}})
        end
    }
}

require('lazy').setup(lazyplugins)