0xstepit / flow.nvim

A flow-immersive Nvim colorscheme with fluorescent details.
Apache License 2.0
189 stars 7 forks source link

Default config causes an error #1

Closed NielsCodes closed 3 months ago

NielsCodes commented 3 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

N/A

Operating system/version

MacOS

Describe the bug

The default config in the readme leads to an error. This is caused by setting the name to "Flow" but then attempting to require("flow"). This leads to an error on startup, since we're attempting to call setup() on a nil value. Can be fixed simply by leaving out the name property

Here is the received error:

Failed to run `config` for Flow

/Users/niels/.config/nvim/lua/plugins/theme.lua:24: attempt to call field 'setup' (a nil value)

# stacktrace:
  - lua/plugins/theme.lua:24 _in_ **config**
  - lua/config/lazy.lua:19
  - init.lua:74

Steps To Reproduce

Use the following config (from the docs):

return {
  "0xstepit/flow.nvim",
  name = "Flow",
  lazy = false,
  priority = 1000,
  opts = {},
  config = function()
    require("flow").setup{
      transparent = false, -- Set transparent background.
      fluo_color = "pink", --  Fluo color: pink, yellow, orange, or green.
      mode = "normal", -- Intensity of the palette: normal, dark, or bright. Notice that dark is ugly!
      aggressive_spell = false, -- Display colors for spell check.
    }

    vim.cmd "colorscheme flow"
  end,
}

Expected Behavior

It should setup, but doesn't.

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 = {
  "0xstepit/flow.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("flow")
-- add anything else here
0xstepit commented 3 months ago

Hey @NielsCodes thanks for opening this issue! You're right, I also believe it is better to have the default config without renaming the plugin. Thanks a lot 🙏

0xstepit commented 3 months ago

Fixed! Thanks again