-- 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/trouble.nvim",
branch = "dev",
opts = {}
},
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
vim.opt.colorcolumn = { 10, 11, 12, 13, 14, 15 }
vim.api.nvim_create_autocmd( "FileType", {
pattern = "trouble",
callback = function()
vim.opt_local.colorcolumn = ""
end
})
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.10.0-dev-2274+g1d5f86f69-Homebrew
Operating system/version
MacOS 14.4.1
Describe the bug
I can't turn off colorcolumn with autocommand, see the
repro.lua
.This worked with previous version.
Steps To Reproduce
nvim -u repro.lua
:Trouble diagnostics
Expected Behavior
Colorcolumn in trouble window shouldn't be displayed, but it is:
https://github.com/folke/trouble.nvim/assets/16707112/5face428-d8e2-4be6-8948-cc4dcc22a5aa
It can be only turned off manually with
:setlocal cc=
Repro