Skip to content

Commit

Permalink
Automatically use nvim-notify when available
Browse files Browse the repository at this point in the history
Fixes #10
  • Loading branch information
epwalsh committed Dec 27, 2023
1 parent f6ac30a commit d0d87bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion lua/pomo/notifiers/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d0d87bc

Please sign in to comment.