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: Error while calling lua chunk #106

Closed
idelice opened this issue Jul 28, 2024 · 2 comments
Closed

bug: Error while calling lua chunk #106

idelice opened this issue Jul 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@idelice
Copy link

idelice commented Jul 28, 2024

Description

   Error  14:27:08 notify.error lazy.nvim Failed to run `config` for cyberdream.nvim

vim/_editor.lua:0: /Users/delice/.config/nvim/init.lua..nvim_exec2() called at /Users/delice/.config/nvim/init.lua:0../Users/delice/.local/share/nvim/lazy/cyberdream.nvim/colors/cyberdream.lua: Vim(colorscheme):E5113: Error while calling lua chunk: .../share/nvim/lazy/cyberdream.nvim/lua/cyberdream/util.lua:20: invalid key: style
stack traceback:
	[C]: in function 'nvim_set_hl'
	.../share/nvim/lazy/cyberdream.nvim/lua/cyberdream/util.lua:20: in function 'syntax'
	.../share/nvim/lazy/cyberdream.nvim/lua/cyberdream/util.lua:35: in function 'load'
	.../share/nvim/lazy/cyberdream.nvim/lua/cyberdream/init.lua:12: in function 'load'
	...al/share/nvim/lazy/cyberdream.nvim/colors/cyberdream.lua:1: in main chunk
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	/Users/delice/.config/nvim/lua/plugins/cyberdream.lua:26: in function 'config'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:376: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:374>
	[C]: in function 'xpcall'
	.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:135: in function 'try'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:391: in function 'config'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:358: in function '_load'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:197: in function 'load'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:127: in function 'startup'
	...elice/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:112: in function 'setup'
	/Users/delice/.config/nvim/lua/config/lazy.lua:9: in main chunk
	[C]: in function 'require'
	/Users/delice/.config/nvim/init.lua:2: in main chunk

# stacktrace:
  - vim/_editor.lua:0 _in_ **cmd**
  - ~/.config/nvim/lua/plugins/cyberdream.lua:26 _in_ **config**
  - ~/.config/nvim/lua/config/lazy.lua:9
  - ~/.config/nvim/init.lua:2

Neovim version?

0.10.0

What should happen?

No error when opening nvim

What happened instead?

Error

Your configuration

return {
  "scottmckendry/cyberdream.nvim",
  lazy = false,
  priority = 1000,
  config = function()
    require("cyberdream").setup({
      -- Recommended - see "Configuring" below for more config options
      transparent = true,
      italic_comments = true,
      hide_fillchars = true,
      borderless_telescope = false,
      terminal_colors = true,
      theme = {
        -- variant = "light",
        highlights = {
          CursorLineNr = { fg = "#ff9e64", style = "bold" },
          MiniFilesBorder = { fg = "#ff9e64" },
          -- Type = { fg = "NONE", bg = "NONE" },
          -- Keyword = { fg = "NONE", bg = "NONE" },
          TelescopeBorder = { fg = "#ff9e64" },
          -- IndentLineCurrent = { fg = "#7b8496" },
          -- MiniIndentscopeSymbol = { fg = "#7b8496" },
        },
      },
    })
    vim.cmd("colorscheme cyberdream") -- set the colorscheme

    vim.api.nvim_create_autocmd("BufEnter", {
      pattern = "*.java",
      callback = function()
        -- Disable some syntax highlighting for Java files
        -- print("Jave files detected. Disabling syntax highlighting for Java files.")
        vim.api.nvim_command("highlight Keyword guifg=NONE")
        vim.api.nvim_command("highlight Type guifg=NONE")
      end,
    })

    vim.api.nvim_create_autocmd("BufEnter", {
      pattern = { "*.tsx", "*.ts", "*.js", "*.jsx" },
      callback = function()
        -- Re-enable syntax highlighting for non-Java files.
        -- print("Re-enabling syntax highlighting for TypeScript and JavaScript files.")
        vim.api.nvim_command("highlight link Keyword Number")
        vim.api.nvim_command("highlight link Type Operator")
      end,
    })
  end,
}
@idelice idelice added the bug Something isn't working label Jul 28, 2024
@scottmckendry
Copy link
Owner

Hello @idelice ,

If you change CursorLineNr = { fg = "#ff9e64", style = "bold" } to CursorLineNr = { fg = "#ff9e64", bold = true } it should resolve the error.

The reason is because style isn't a valid option when calling vim.api.nvim_set_hl.

Up until 3.7.0, these were being converted into valid options during setup. I'd converted all the instances within the plugin before removing that code, but I hadn't considered anyone would have them in their own overrides. Sorry about that!

@scottmckendry scottmckendry added the waiting for op This issue is waiting for a response from the original poster label Jul 28, 2024
@idelice
Copy link
Author

idelice commented Jul 28, 2024

Hello @idelice ,

If you change CursorLineNr = { fg = "#ff9e64", style = "bold" } to CursorLineNr = { fg = "#ff9e64", bold = true } it should resolve the error.

The reason is because style isn't a valid option when calling vim.api.nvim_set_hl.

Up until 3.7.0, these were being converted into valid options during setup. I'd converted all the instances within the plugin before removing that code, but I hadn't considered anyone would have them in their own overrides. Sorry about that!

Thank you. That fixed it!

@idelice idelice closed this as completed Jul 28, 2024
@github-actions github-actions bot removed the waiting for op This issue is waiting for a response from the original poster label Jul 28, 2024
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