Open KaspervdHeijden opened 1 week ago
Thanks for the suggestion!
I think the proper way is to add some kind of source
field to notification specification. One small issue is that add()
was not really designed to be extensible (mostly by design to limit complexity). I'd take some time to think if adding source
as fourth argument is worth it.
Fair enough. My current workaround is quite hacky:
notify.setup({
content = {
format = function (str)
local parts = vim.split(str.msg, ': ')
if #parts == 2 then
return parts[2]
end
return string.format('\n %s \n', str.msg)
end,
},
window = {
winblend = 0,
config = function ()
local pad = vim.o.cmdheight + (vim.o.laststatus > 0 and 1 or 0)
return {
row = vim.o.lines - pad - 1,
col = vim.o.columns,
border = 'none',
anchor = 'SE',
}
end,
}
})
})
Fair enough. My current workaround is quite hacky:
I don't find the code particularly hacky, on the contrary even - quite concise and to the point. The fact that it is applied to any notification and not only to the ones coming from LSP progress - yeah, maybe.
Contributing guidelines
Module(s)
mini.notify
Description
Currently the LSP progress message format is hardcoded. See https://github.com/echasnovski/mini.nvim/blob/df1559e2ed7ece458e0a97a8bb9556d465d1c775/lua/mini/notify.lua#L678
It would be nice to make this more dynamic, via a format function.