willothy / veil.nvim

A blazingly fast, animated, and infinitely customizeable startup / dashboard plugin (currently unmaintained, but with plans for a ground-up rewrite)
151 stars 7 forks source link

`invalid key` error when using smaller displays #2

Closed olimorris closed 1 year ago

olimorris commented 1 year ago

With the following minimal.lua file:

local root = vim.fn.fnamemodify("./.repro", ":p")

-- Set stdpaths to use root dir
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 = {
  {
    "willothy/veil.nvim",
    config = true
  },
  -- Put any other plugins here
}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

I get the following error:

Error detected while processing VimEnter Autocommands for "*":
Error executing lua callback: .../.dotfiles/.repro/plugins/veil.nvim/lua/veil/section.lua:101: invalid key:
stack traceback:
        [C]: in function 'nvim_set_hl'
        .../.dotfiles/.repro/plugins/veil.nvim/lua/veil/section.lua:101: in function 'render'
        /Users/Oli/.dotfiles/.repro/plugins/veil.nvim/lua/veil.lua:113: in function 'redraw'
        /Users/Oli/.dotfiles/.repro/plugins/veil.nvim/lua/veil.lua:55: in function 'display'
        /Users/Oli/.dotfiles/.repro/plugins/veil.nvim/lua/veil.lua:180: in function </Users/Oli/.dotfiles/.repro/plugins/veil.nvim/lua/veil.lua:178>

when I try and open up Neovim, when using my laptop screen. It works perfectly on my bigger monitor.

willothy commented 1 year ago

Thanks! Hopefully will have this one fixed by tomorrow.

willothy commented 1 year ago

Turned out to be pretty simple, should be all good now!

olimorris commented 1 year ago

Still getting the same error unfortunately, but with updated line numbers:

Error detected while processing VimEnter Autocommands for "*":
Error executing lua callback: /Users/Oli/.dotfiles/.repro/plugins/veil.nvim/lua/veil.lua:137: Invalid 'line': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        /Users/Oli/.dotfiles/.repro/plugins/veil.nvim/lua/veil.lua:137: in function 'redraw'
        /Users/Oli/.dotfiles/.repro/plugins/veil.nvim/lua/veil.lua:55: in function 'display'
        /Users/Oli/.dotfiles/.repro/plugins/veil.nvim/lua/veil.lua:180: in function </Users/Oli/.dotfiles/.repro/plugins/vei
l.nvim/lua/veil.lua:178>

I'm on a 14" MacBook Pro btw 😆

willothy commented 1 year ago

Hmm, that's weird. I'll keep looking into it, though I can't repro anymore.

adelarsq commented 1 year ago

@willothy Will be possible to reproduce using a bigger font on the terminal. For a certain size works fine.