summaryrefslogtreecommitdiff
path: root/lua/lvim/core/notify.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-10-23 13:11:05 +0200
committerGitHub <[email protected]>2021-10-23 13:11:05 +0200
commit0ea08c7a1c1de5cb381351230d11513e287c42db (patch)
treec2eb2a90a7b51ae5fb2eea28b4d3f4df23728131 /lua/lvim/core/notify.lua
parenta96a44a16a46dae0aee0f5689ccfe644d2a27c0f (diff)
fix(log): don't rely on lvim.builtin.notify.active (#1831)
Diffstat (limited to 'lua/lvim/core/notify.lua')
-rw-r--r--lua/lvim/core/notify.lua28
1 files changed, 21 insertions, 7 deletions
diff --git a/lua/lvim/core/notify.lua b/lua/lvim/core/notify.lua
index 7d222a89..5339357b 100644
--- a/lua/lvim/core/notify.lua
+++ b/lua/lvim/core/notify.lua
@@ -2,25 +2,26 @@ local M = {}
function M.config()
local pallete = require "onedarker.palette"
+
lvim.builtin.notify = {
active = false,
on_config_done = nil,
-- TODO: update after https://github.com/rcarriga/nvim-notify/pull/24
opts = {
- ---@usage Animation style (see below for details)
- stages = "fade_in_slide_out",
+ ---@usage Animation style one of { "fade", "slide", "fade_in_slide_out", "static" }
+ stages = "slide",
- ---@usage Default timeout for notifications
+ ---@usage timeout for notifications in ms, default 5000
timeout = 5000,
- ---@usage For stages that change opacity this is treated as the highlight behind the window
+ ---@usage highlight behind the window for stages that change opacity
background_colour = pallete.fg,
---@usage Icons for the different levels
icons = {
- ERROR = "",
- WARN = "",
- INFO = "",
+ ERROR = "",
+ WARN = "",
+ INFO = "",
DEBUG = "",
TRACE = "✎",
},
@@ -28,4 +29,17 @@ function M.config()
}
end
+M.params_injecter = function(_, entry)
+ -- FIXME: this is currently getting ignored or is not passed correctly
+ for key, value in pairs(lvim.builtin.notify.opts) do
+ entry[key] = value
+ end
+ return entry
+end
+
+M.default_namer = function(logger, entry)
+ entry["title"] = logger.name
+ return entry
+end
+
return M