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

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

Open
gorillamoe opened this issue Mar 20, 2024 · 8 comments

Comments

@gorillamoe
Copy link

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
Copy link
Author

gorillamoe commented Mar 20, 2024

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
Copy link
Author

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
Copy link

kaykhan commented Jun 11, 2024

Im also getting this issue, is there a fix?

@gorillamoe
Copy link
Author

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 🤷

@stephanedemotte
Copy link

Same here got Invalid filter

@realth000
Copy link

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
Copy link

rcarmo commented Sep 6, 2024

Getting the same error with latest version.

@rcarmo
Copy link

rcarmo commented Sep 8, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants