Something went wrong. Try again.
neovim configuration using rocks.nvim plugin manager
Something went wrong. Try again.
1.2 kB · 53 lines
Lua
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354---@class bt.util.notifylocal M = {}
---@alias BtNotifyOpts {lang?:string, title?:string, level?:number, once?:boolean}
---@param msg string|string[]---@param opts? BtNotifyOptsfunction M.notify(msg, opts) if vim.in_fast_event() then return vim.schedule(function() M.notify(msg, opts) end) end
opts = opts or {} if type(msg) == "table" then msg = table.concat( vim.tbl_filter(function(line) return line or false end, msg), "\n" ) end vim.notify(msg, opts.level or vim.log.levels.INFO, { title = opts.title or "config", })end
---@param msg string|string[]---@param opts? BtNotifyOptsfunction M.error(msg, opts) opts = opts or {} opts.level = vim.log.levels.ERROR M.notify(msg, opts)end
---@param msg string|string[]---@param opts? BtNotifyOptsfunction M.info(msg, opts) opts = opts or {} opts.level = vim.log.levels.INFO M.notify(msg, opts)end
---@param msg string|string[]---@param opts? BtNotifyOptsfunction M.warn(msg, opts) opts = opts or {} opts.level = vim.log.levels.WARN M.notify(msg, opts)end
return M