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

Error Occurs in catppuccin When Used with feline and no Cache File Exists #616

Closed
tummetott opened this issue Nov 17, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@tummetott
Copy link

tummetott commented Nov 17, 2023

Description

I encountered a bug that was challenging to isolate into a minimal configuration. The steps to reproduce may seem trivial, but they are the simplest way to manifest the issue.

When running catppuccin alongside feline, and no cache file exists (important only in the absence of a cache file), an unusual error occurs when the WinScrolled autocmd is triggered:

(UNKNOWN PLUGIN): Error executing lua: attempt to call a number value
stack traceback:

My suspicion is that this error is related to catppuccin's bytecode compiler, as it only appears when catppuccin compiles the custom_highlights section of the user config. Strangely, once a cache file exists, the error disappears.

It's noteworthy that this bug requires the presence of feline for reproduction. I speculate that when the CursorMoved autocmd is triggered, feline renders the statusline, accessing something related to catppuccin. However, the error message is truncated and not displayed on the command line.

Neovim version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1696795921

Terminal and multiplexer

kitty 0.29.2 with tmux 3.3a

Catppuccin version / branch / rev

v1.5.0

Steps to reproduce

  1. nvim --clean -u repro.lua
  2. :qa
  3. rm .repro/cache/nvim/catppuccin/cached
  4. nvim --clean -u repro.lua
  5. :doautocmd CursorMoved

--> Error is printed on the screen

Expected behavior

No error

Actual behavior

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)

vim.opt.termguicolors = true

-- install plugins
local plugins = {
    {
        'catppuccin/nvim',
        name = 'catppuccin',
        tag = 'v1.5.0',
        opts = {}
    },
    {
        'freddiehaddad/feline.nvim',
        opts = {
            custom_highlights = function()
                return {
                    NormalFloat = { link = 'Normal' }
                }
            end
        },
    }
    -- add any other plugins here
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

vim.cmd.colorscheme("catppuccin")
@tummetott tummetott added the bug Something isn't working label Nov 17, 2023
@tummetott
Copy link
Author

tummetott commented Nov 18, 2023

I reallized that I can reproduce the error without deleting the cached file when treesitter is NOT lazy loading. The same error occurs now on every start of nvim

@tummetott
Copy link
Author

After further investigation i realized this is no bug of catppuccin. I could reproduce it without this plugin. I assume it's a bug of feline, but I still don't understand it. Will create an issue there.

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

1 participant