darkvoid-theme / darkvoid.nvim

Neovim Colorscheme for dark dwellers with optional glow effect!
MIT License
144 stars 9 forks source link

Fix for LazyVim throwing an error when attempting to set darkvoid as the colorscheme #10

Closed ficcdaf closed 2 weeks ago

ficcdaf commented 2 weeks ago

Note: I am already addressing this and will submit a PR soon. This issue is here for reference.

The Bug

What is says on the tin. Setting darkvoid as the colorscheme when using LazyVim throws the following error:

Error  12:42:29 AM notify.error lazy.nvim Failed to run `config` for bufferline.nvim

...re/nvim/lazy/LazyVim/lua/lazyvim/plugins/colorscheme.lua:58: attempt to index field 'colors_name' (a nil value)

This is because LazyVim's colorscheme.lua (part of the default config stored in ~/.local/share/nvim) always runs the following snippet:

          if vim.g.colors_name:find("catppuccin") then
            opts.highlights = require("catppuccin.groups.integrations.bufferline").get()
          end

While this isn't a real problem necessarily in that it doesn't affect functionality, seeing an error message every time launching Neovim is 1. inelegant, 2. may cause some users to think something is wrong, prompting them to uninstall the theme.

The Reason

The reason is because darkvoid doesn't set vim.g.colors_name in init.lua, which seems to be common practice among other colorscheme plugins.

My Proposed Solution

I propose simply setting vim.g.colors_name to darkvoid in init.lua.

This change should not break anything, and it should make darkvoid compatible with more users' Neovim setups, such as LazyVim users.

Aliqyan-21 commented 2 weeks ago

Thank you @ficcdaf for identifying this error and for working on it