diff options
author | kylo252 <[email protected]> | 2021-10-24 08:37:02 +0200 |
---|---|---|
committer | kylo252 <[email protected]> | 2021-10-24 08:37:02 +0200 |
commit | 1f2167df0ea3f837c9c78a0137a888ca05e5e83a (patch) | |
tree | 6fd46809d7dd4ff7fffae00b257579397de793cd /lua/lvim/core/notify.lua | |
parent | 30de3736baec9a72134205de91f3388e3ea68bcf (diff) | |
parent | 3dd60bd3d4165b14844a514d519f3810b8142a02 (diff) |
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/core/notify.lua')
-rw-r--r-- | lua/lvim/core/notify.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lua/lvim/core/notify.lua b/lua/lvim/core/notify.lua new file mode 100644 index 00000000..5339357b --- /dev/null +++ b/lua/lvim/core/notify.lua @@ -0,0 +1,45 @@ +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 one of { "fade", "slide", "fade_in_slide_out", "static" } + stages = "slide", + + ---@usage timeout for notifications in ms, default 5000 + timeout = 5000, + + ---@usage highlight behind the window for stages that change opacity + background_colour = pallete.fg, + + ---@usage Icons for the different levels + icons = { + ERROR = "ï™™", + WARN = "", + INFO = "ï µ", + DEBUG = "", + TRACE = "✎", + }, + }, + } +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 |