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

Default integration settings when default_integrations = false #763

Open
stasjok opened this issue Aug 24, 2024 · 0 comments
Open

Default integration settings when default_integrations = false #763

stasjok opened this issue Aug 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@stasjok
Copy link

stasjok commented Aug 24, 2024

Description

Consider the following configuration:

require("catppuccin").setup({
    default_integrations = false,
    integrations = {
        native_lsp = {enabled = true},
    }
})

I expected this to be equivalent to the default native_lsp configuration (which includes underlines and italics), but instead I've got the following error:

E5108: Error executing lua ...n-pack/lua/catppuccin/groups/integrations/native_lsp.lua:0: attempt to index field 'virtu
al_text' (a nil value)                                                                                                 
stack traceback:                                                                                                       
        ...n-pack/lua/catppuccin/groups/integrations/native_lsp.lua: in function 'get'                                 
        ...tart/vimplugin-plugin-pack/lua/catppuccin/lib/mapper.lua: in function 'apply'                               
        ...rt/vimplugin-plugin-pack/lua/catppuccin/lib/compiler.lua: in function 'compile'                             
        ...ages/start/vimplugin-plugin-pack/lua/catppuccin/init.lua: in function 'compile'                             
        ...ages/start/vimplugin-plugin-pack/lua/catppuccin/init.lua: in function 'setup'                               
        [string ":{range}lua"]:1: in main chunk

I must specify the entire native_lsp configuration rather than just setting {enabled = true}.

It is likely that the same issue present for other integrations that are enabled with {enabled = true}.

Consider setting default integration settings even when default_integrations = false.

Neovim version

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1713773202

Terminal and multiplexer

Windows Terminal with tmux 3.4

Catppuccin version / branch / rev

4fd72a9

Steps to reproduce

  1. nvim -u repro.lua.

Expected behavior

No error.

Actual behavior

Error:

Error detected while processing /tmp/repro/repro.lua:
E5113: Error while calling lua chunk: ...s/nvim/lua/catppuccin/groups/integrations/native_lsp.lua:27: attempt to index
local 'virtual_text' (a nil value)
stack traceback:
        ...s/nvim/lua/catppuccin/groups/integrations/native_lsp.lua:27: in function 'get'
        .../repro/.repro/plugins/nvim/lua/catppuccin/lib/mapper.lua:52: in function 'apply'
        ...epro/.repro/plugins/nvim/lua/catppuccin/lib/compiler.lua:24: in function 'compile'
        /tmp/repro/.repro/plugins/nvim/lua/catppuccin/init.lua:125: in function 'compile'
        /tmp/repro/.repro/plugins/nvim/lua/catppuccin/init.lua:198: in function 'setup'
        /tmp/repro/repro.lua:25: in main chunk

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

require("catppuccin").setup({
  default_integrations = false,
  integrations = {
    native_lsp = {enabled = true},
  }
})

vim.cmd.colorscheme("catppuccin")
@stasjok stasjok added the bug Something isn't working label Aug 24, 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

1 participant