luukvbaal / statuscol.nvim

Status column plugin that provides a configurable 'statuscolumn' and click handlers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lightbulb.nvim not being caught by wildcard

jan-xyz opened this issue · comments

I am using https://github.com/kosayoda/nvim-lightbulb to show LSP code actions in the sign column, but it's not being caught by the wildcard sign segment. I now added another one, just catching that one. What's the problem? Is there something missing in lightbulb.nvim that I can maybe fix upstream?

local builtin = require("statuscol.builtin")
require("statuscol").setup({
	relculright = true,
	segments = {
		{ text = { builtin.foldfunc }, click = "v:lua.ScFa" },
		{ text = { builtin.lnumfunc }, click = "v:lua.ScLa" },
		{ sign = { text = { "💡" }, maxwidth = 1, colwidth = 1 } }, -- Support for kosayoda/nvim-lightbulb which somhow doesn't match the below
		{ sign = { name = { ".*" }, maxwidth = 2, colwidth = 1 }, click = "v:lua.ScSa" },
	},
})

The lightbulb is placed as an extmark sign. Hence it needs a namespace or text sign segment.
Both can be supplied to the same segment. This should work:

local builtin = require("statuscol.builtin")
require("statuscol").setup({
	relculright = true,
	segments = {
		{ text = { builtin.foldfunc }, click = "v:lua.ScFa" },
		{ text = { builtin.lnumfunc }, click = "v:lua.ScLa" },
		{ sign = { name = { ".*" }, namespace = { ".*" }, maxwidth = 2, colwidth = 1 }, click = "v:lua.ScSa" },
	},
})

ah nice! I didn't try to merge the two 🤦 , I went with yours but instead of namespace = ".*" I had to use text = ".*". It doesn't work with the namespace :-/