updates
This commit is contained in:
1 parent
24feea3d4a
commit
9178d9ad60
8 files changed
+105
-74
No files matched your search
+17
-54
@@ -1,56 +1,19 @@
|
||||
local notify = require('notify')
|
||||
vim.notify = require("notify")
|
||||
|
||||
local icons = require('lib.icons')
|
||||
|
||||
notify.setup({
|
||||
background_colour = '#000',
|
||||
fps = 30,
|
||||
icons = {
|
||||
DEBUG = icons.ui.Bug,
|
||||
ERROR = icons.diagnostics.Error,
|
||||
INFO = icons.diagnostics.Information,
|
||||
TRACE = icons.ui.Bookmark,
|
||||
WARN = icons.diagnostics.Warning,
|
||||
},
|
||||
level = 2,
|
||||
render = 'default',
|
||||
stages = 'fade_in_slide_out',
|
||||
timeout = 2000,
|
||||
top_down = true,
|
||||
|
||||
max_height = function()
|
||||
return math.floor(vim.o.lines * 0.75)
|
||||
end,
|
||||
max_width = function()
|
||||
return math.floor(vim.o.columns * 0.75)
|
||||
end,
|
||||
on_open = function(win)
|
||||
vim.api.nvim_win_set_config(win, { zindex = 100 })
|
||||
end,
|
||||
require("notify").setup({
|
||||
background_colour = "Normal",
|
||||
fps = 30,
|
||||
icons = {
|
||||
DEBUG = " ",
|
||||
ERROR = " ",
|
||||
INFO = " ",
|
||||
TRACE = "✎",
|
||||
WARN = " "
|
||||
},
|
||||
level = 2,
|
||||
minimum_width = 30,
|
||||
maximum_width = 30,
|
||||
render = "wrapped-compact",
|
||||
stages = "slide",
|
||||
timeout = 2000
|
||||
})
|
||||
|
||||
-- Controls noisy notifications
|
||||
local buffered_messages = {
|
||||
'Client %d+ quit',
|
||||
'No node found at cursor',
|
||||
}
|
||||
|
||||
local message_notifications = {}
|
||||
vim.notify = function(msg, level, opts)
|
||||
opts = opts or {}
|
||||
for _, pattern in ipairs(buffered_messages) do
|
||||
if string.find(msg, pattern) then
|
||||
if message_notifications[pattern] then
|
||||
opts.replace = message_notifications[pattern]
|
||||
end
|
||||
|
||||
opts.on_close = function()
|
||||
message_notifications[pattern] = nil
|
||||
end
|
||||
message_notifications[pattern] = notify.notify(msg, level, opts)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
notify.notify(msg, level, opts)
|
||||
end
|
||||
Reference in new issue
Block a user