this overrides the default alts for FIX resulting in only FIX and CHANGE ME working.
So I tried to append it to the options
return {
{
"folke/todo-comments.nvim",
opts = function(_, opts)
local alts = { FIX = { "CHANGE ME" } }
if opts.keywords ~= nil and opts.keywords.FIX ~= nil and opts.keywords.FIX.alt ~= nil then
vim.list_extend(opts.keywords.FIX.alt, alts.FIX)
else
return vim.tbl_deep_extend("force", opts, { keywords = { FIX = { alt = alts.FIX } } })
end
end,
},
}
but this doesn't work because the param opts is always empty, resulting in the same thing
Steps To Reproduce
install todo comments and try to add a single alt
Expected Behavior
I understand why the first method fails, it overrides the list. But I expected the second one to work
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 = {
"folke/tokyonight.nvim",
"folke/todo-comments.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0-dev-2961+g4d52b0cf6
Operating system/version
Linux archlinux 6.8.2-arch2-1
Describe the bug
I'm using
LazyVim
and I'm trying to add an alt to theFIX
keywordthis overrides the default alts for
FIX
resulting in onlyFIX
andCHANGE ME
working.So I tried to append it to the options
but this doesn't work because the param
opts
is always empty, resulting in the same thingSteps To Reproduce
install todo comments and try to add a single alt
Expected Behavior
I understand why the first method fails, it overrides the list. But I expected the second one to work
Repro