epwalsh / pomo.nvim

:new: :stopwatch: A simple, customizable pomodoro timer for Neovim, written in Lua, with nvim-notify, lualine, and telescope integrations
Apache License 2.0
154 stars 7 forks source link

Timer is sticky even with { sticky = false } & "TimerHide" not an editor command #7

Closed Gl00ria closed 7 months ago

Gl00ria commented 7 months ago

🐛 Describe the bug

First, thanks for this great plugin.

This is a two-in-one issue report, so I am running on the default config as the timer works perfectly, but it is still sticky all the time even when option( sticky = false ).

In addition, I tried the command TimerHide but it gives me an error Not an editor command: TimerHide.

local settings_status, settings = pcall(require, "control_center")
if not settings_status then
    vim.notify("[settings] failed to load within (pomodoro.lua)", vim.log.levels.WARN)
    return
end

local pomo = {}

if settings.enable_pomodoro_pomo then
    pomo = {
        "epwalsh/pomo.nvim",
        dependencies = { "rcarriga/nvim-notify" },
        version = "*", -- Recommended, use latest release instead of latest commit
        cmd = { "TimerStart", "TimerStop", "TimerRepeat", "TimerHide" },
        keys = {
            {
                "<F4>",
                "<cmd>TimerStart 25m<CR>",
                desc = "Pomodoro Start",
            },
        },
        config = function()
            local pomo_status, pomo_ = pcall(require, "pomo")
            if not pomo_status then
                vim.notify("Plugin [pomo] failed to load within (pomodoro.lua)", vim.log.levels.WARN)
                return
            end
            pomo_.setup({

                -- How often the notifiers are updated.
                update_interval = 1000,

                -- Configure the notifiers to use for each timer that's created.
                notifiers = {
                    -- The "Default" timer uses 'nvim-notify' to continuously display the timer
                    {
                        name = "Default",
                        opts = {
                            sticky = false, -- set to false if you don't want to see the timer the whole time
                            title_icon = "󱎫",
                            text_icon = "󰄉",
                            -- Replace the above with these if you don't have a patched font:
                            -- title_icon = "⏳",
                            -- text_icon = "⏱️",
                        },
                    },

                    -- The "System" notifier sends a system notification when the timer is finished.
                    -- Currently this is only available on MacOS.
                    -- { name = "System" },

                    -- You can also define custom notifiers by providing an "init" function instead of a name.
                    -- See "Defining custom notifiers" below for an example 👇
                    -- { init = function(timer) ... end }
                },

                -- Override the notifiers for specific timer names.
                -- timers = {
                --     -- For example, use only the "System" notifier when you create a timer called "Break"
                --     Break = {
                --         { name = "System" },
                --     },
                -- },
            })
        end,
    }
end

return {
    pomo,
}

Versions

nvim --version

Build type: Release
LuaJIT 2.1.1700008891

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

nvim --headless -c 'lua print(require("pomo.version"))' -c q 0.3.0

epwalsh commented 7 months ago

Hey @Gl00ria that was a recent addition. If you upgrade to 0.4.1 it should work.

Gl00ria commented 7 months ago

Appreciate your responce, works perfectly now.