nvim-notify
nvim-notify copied to clipboard
FR: add padding to the side
Using this command:
lua require("notify")("Hello World")
the result currently looks like this

However, the padding to the top and bottom is larger than to the left; something like this would look more consistent

I don't really want to start editing the messages in the render function, because then we'll have to deal with formatting, wrapping etc. Once anticonceal is merged, this should be possible without needing to do that.
Until then you can do add this to your own config if you're not worried about the above issues:
render = function(bufnr, notif, highlights)
local base = require("notify.render.base")
local namespace = base.namespace()
local padded_message = vim.tbl_map(function(line)
return " " .. line
end, notif.message)
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, padded_message)
vim.api.nvim_buf_set_extmark(bufnr, namespace, 0, 0, {
hl_group = highlights.icon,
end_line = #notif.message - 1,
end_col = #notif.message[#notif.message],
priority = 50,
})
end,
hmmm, your snippet does work for me, but I also don't think it's worth spending the time debugging when the issue would be tackled via the upstream anticonceal feature anyway. Thank for letting me know!
Sure, happy to leave this open for when anticonceal is added :+1:
Reference: https://github.com/neovim/neovim/pull/9496/