Skip to content
Discussion options

You must be logged in to vote
---@module 'snacks'

local notifs = {}

---@param msg string
---@param title? string
---@param level? string|number
local key = function(msg, title, level)
  return string.format('msg:%s,title:%s,level:%s', msg, title or '', level or '')
end

---@param notif snacks.notifier.Notif
local use_count = function(notif)
  local get_count = function()
    return notifs[key(notif.msg, notif.title, notif.level)] or 0
  end
  ---@param num integer
  local set_count = function(num)
    notifs[key(notif.msg, notif.title, notif.level)] = num
  end
  return get_count, set_count
end

return {
  'folke/snacks.nvim',
  config = function(_, spec_opts)
    require('snacks').setup(spec_opts)
    --
    local n…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@acid-bong
Comment options

@acid-bong
Comment options

@acid-bong
Comment options

@drowning-cat
Comment options

@tlmp59
Comment options

Answer selected by tlmp59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants