mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(notifier): no gap in border without title/icon (#85)
## Description Don't put padding with no title and no icon, so that there is no gap in the border. <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> ## Related Issue(s) Fixes #84. <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots <!-- Add screenshots of the changes if applicable. --> --------- Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
parent
f126609b57
commit
bc80bdcc62
1 changed files with 5 additions and 4 deletions
|
@ -144,10 +144,11 @@ end
|
|||
N.styles = {
|
||||
-- style using border title
|
||||
compact = function(buf, notif, ctx)
|
||||
ctx.opts.title = {
|
||||
{ " " .. vim.trim(notif.icon .. " " .. (notif.title or "")) .. " ", ctx.hl.title },
|
||||
}
|
||||
ctx.opts.title_pos = "center"
|
||||
local title = vim.trim(notif.icon .. " " .. (notif.title or ""))
|
||||
if title ~= "" then
|
||||
ctx.opts.title = { { " " .. title .. " ", ctx.hl.title } }
|
||||
ctx.opts.title_pos = "center"
|
||||
end
|
||||
vim.api.nvim_buf_set_lines(buf, 0, -1, false, vim.split(notif.msg, "\n"))
|
||||
end,
|
||||
minimal = function(buf, notif, ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue