Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lua/notify/render/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local api = vim.api
local base = require("notify.render.base")

return function(bufnr, notif, highlights, config)
local left_icon = notif.icon .. " "
local left_icon = notif.icon == "" and "" or notif.icon .. " "
local max_message_width = math.max(math.max(unpack(vim.tbl_map(function(line)
return vim.fn.strchars(line)
end, notif.message))))
Expand All @@ -16,12 +16,11 @@ return function(bufnr, notif, highlights, config)

local namespace = base.namespace()
api.nvim_buf_set_lines(bufnr, 0, 1, false, { "", "" })

local virt_text = left_icon == "" and {} or { { " " }, { left_icon, highlights.icon } }
table.insert(virt_text, { left_title .. left_buffer, highlights.title })
api.nvim_buf_set_extmark(bufnr, namespace, 0, 0, {
virt_text = {
{ " " },
{ left_icon, highlights.icon },
{ left_title .. left_buffer, highlights.title },
},
virt_text = virt_text,
virt_text_win_col = 0,
priority = 10,
})
Expand Down