diff --git a/CHANGELOG.md b/CHANGELOG.md index 4272d6d..052fb10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - You can now pass `-1` as the `TIMERID` to apply a command to all active timers. +### Fixed + +- Automatically use `nvim-notify` when available. + ## [v0.4.1](https://github.com/epwalsh/pomo.nvim/releases/tag/v0.4.1) - 2023-12-01 ### Fixed diff --git a/lua/pomo/notifiers/default.lua b/lua/pomo/notifiers/default.lua index 680bfc2..51c70d0 100644 --- a/lua/pomo/notifiers/default.lua +++ b/lua/pomo/notifiers/default.lua @@ -59,7 +59,13 @@ DefaultNotifier._update = function(self, text, level, timeout) assert(text) - self.notification = vim.notify(text, level, { + local ok, notify = pcall(require, "notify") + if not ok then + ---@diagnostic disable-next-line: cast-local-type + notify = vim.notify + end + + self.notification = notify(text, level, { icon = self.title_icon, title = title, timeout = timeout,