folke / styler.nvim

Simple Neovim plugin to set a different colorscheme per filetype.
Apache License 2.0
282 stars 7 forks source link

bug: styler.nvim/lua/styler/theme.lua:82: Cannot unset global option value #12

Closed AnoRebel closed 2 months ago

AnoRebel commented 4 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0

Operating system/version

Arch Linux x86_64

Describe the bug

I've mostly noticed this when i use the LSP hover (mine is mapped to 'K'). The popup opens fine but i get this error once every time i open a fresh neovim session and use the hover feature, subsequent use of the feature dont trigger the error. The full error:

Error executing lua callback: ...ocal/share/anonvim/lazy/styler.nvim/lua/styler/theme.lua:82: Cannot unset global option value
stack traceback:
    [C]: in function '__newindex'
    ...ocal/share/anonvim/lazy/styler.nvim/lua/styler/theme.lua:82: in function 'after'
    ...ocal/share/anonvim/lazy/styler.nvim/lua/styler/theme.lua:30: in function 'load'
    ...local/share/anonvim/lazy/styler.nvim/lua/styler/init.lua:17: in function 'set_theme'
    ...local/share/anonvim/lazy/styler.nvim/lua/styler/init.lua:43: in function 'update'
    ...local/share/anonvim/lazy/styler.nvim/lua/styler/init.lua:86: in function <...local/share/anonvim/lazy/styler.nvim/lua/styler/init.lua:85>
    [C]: in function '__newindex'
    ...0.0/nvim-linux64/share/nvim/runtime/lua/vim/lsp/util.lua:1733: in function 'handler'
    ...0/nvim-linux64/share/nvim/runtime/lua/vim/lsp/client.lua:685: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

Steps To Reproduce

  1. Open neovim
  2. Go to any field and use the LSP hover feature

Expected Behavior

No such error

Repro

-- 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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/styler.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
github-actions[bot] commented 3 months ago

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 7 days.

github-actions[bot] commented 2 months ago

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